Python Forum
Python - Analyzing for even intergers and multiples
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python - Analyzing for even intergers and multiples
#1
Hi everyone. I'm having difficulty with an assignment today. Reviewing my textbook, I'm missing any information regarding calculating if an imputed integer is even and a multiple of a specific number.

What I figure I have to do is divide the integer the user inputed by 2 to figure if it's even. However, I don't know how to get past that.

Here is the assignment at hand...

Quote:This program should prompt the user to enter an even integer that is an exact multiple of either 13 or 19. The program should analyze the input and display a congratulatory response for good inputs and informative responses for bad ones. For correct user input, the program should also display the other factor. See sample runs below.

Sample Runs
Enter an even multiple of 13 or 19 381
No. Not EVEN and misses multiple requirement

Enter an even multiple of 13 or 19 247
No. Multiple okay but not EVEN

Enter an even multiple of 13 or 19 260
Good, 260 is 13 * 20.0

def main():
number = int(input('Enter an even multiple of 13 or 19 '))

if number // 13 or 19 == 





main()
Any tips?
Reply


Messages In This Thread
Python - Analyzing for even intergers and multiples - by jhenehan - Sep-03-2017, 08:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Analyzing data seperated by commas Kappel 2 1,944 Aug-07-2019, 01:46 PM
Last Post: ThomasL
  multiples of 3, smaller than 100 sonxy 1 2,511 Mar-27-2018, 10:56 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020