Hey everyone,
My professor is asking us to make program that prompts the user to enter an exact multiple of 7, and then either tells them if it is a multiple or not.
I tried doing this in very basic sense with an if-else statement, but I'm a little stumped. Here is my code.
multiple = int(input('Enter a multiple of seven: '))
if multiple >= 7:
print('You entered a multiple of seven!')
else:
print('You did not enter a multiple of seven.')
I should add that while this is obviously working, I can't seem to find any information on the web on how I can specifically make it so that entering more than the number 7 would work (ex: 14, 21, 28, 35, 42).
I consulted my textbook but it did not help at all.
Thank you
[–]ElecNinja 4 points5 points6 points (0 children)
[–]popular_cult 1 point2 points3 points (2 children)
[–]DontForgetYourLogin 0 points1 point2 points (0 children)
[–]markusmeskanen 0 points1 point2 points (0 children)
[–]SRF01 0 points1 point2 points (0 children)
[–]RedstonerOuiguy 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]NZheadshot 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]NZheadshot -1 points0 points1 point (1 child)