+ 2
Plz help in python
siblings = int(input()) popsicles = int(input()) a=siblings b=popsicles if (a%b)=0: print ("give away") else: print ("eat them yourself")
4 Antworten
+ 8
At line 5 there were to errors one because of it will be (b%a) instead of (a%b) .
And the second one it will be (b%a)==0.
And then it will also showing error on line 7 as there the indentation is unwanted.
siblings = int(input())
popsicles = int(input())
a=siblings
b=popsicles
if (b%a)==0:
print ("give away")
else:
print ("eat them yourself")
+ 1
In line 5, it's supposed to be == instead of = since you're trying to make an operation to check if a%b is equal to 0 or not
In line 7, no need to indent "else" since it doesn't belong to any "if" other than the only "if" operation on line 5; delete that white space
+ 1
In if statement use "==" at place of "=". And there is unwanted space before a (3rd line )
+ 1
Switch the = to ==