I started to learn phyton but I am having a problem in a simple expression which is the following.
number=int(input("enter the number"))
for n in range(40-101):
if n % number is 0:
print(n)
When I write 10 as an input it prints nothing as an output.With my elementary school math,I can easily assume that this should print all the numbers which can be divided by 10.Then the problem should be in the if statement.It doesnt enter to print(n).I know this sounds as an easy question but I am confused since they use "is" in everywhere I use pycharm community edition and python 3.4
Aucun commentaire:
Enregistrer un commentaire