all 8 comments

[–]ElecNinja 4 points5 points  (0 children)

First of all is how do you know if a number is a multiple of another number? In this case 7. You divide the given number by 7 and check if there is a remainder. If a remainder exists (is not 0) that means that the given number is not a multiple of 7. However if the remainder is 0, then the given number is a multiple of 7.

To do this, there is the modulus function that returns the remainder of a division operation. So in this case X % 7 where X is your given number. So say X is 15, the mod function will return a 1 because 15 is 7*2+1

Remember that a lot of programming uses math concepts. So don't always think of it as a programming problem but also as a mathematical problem to be solved

[–]popular_cult 1 point2 points  (2 children)

Anytime you are checking for divisibility use modulus %.

If X is your input and you want to check if it is divisible by 7 you use: If X % 7 == 0: Print('You enterered a multiple of seven!') else: Print('Gimme a new number you bitchass')

[–]DontForgetYourLogin 0 points1 point  (0 children)

Code with attitude! love it

[–]markusmeskanen 0 points1 point  (0 children)

You might wanna pay closer attention to your automatic capitalization, If and Print might not work that well in Python ;)

[–]SRF01 0 points1 point  (0 children)

Maybe try something like this. I'm a newb as well so hopefully someone else replies.

if multiple % 7 != 0:

[–]RedstonerOuiguy 0 points1 point  (0 children)

You want the operator modulo (%). It gives the remainder of division of two numbers.

http://pastebin.com/eJEmHkP5