+ 3
Popsicles Problem Python
I get error. siblings = int(input()) popsicles = int(input()) k = popsicles % siblings #your code goes here if popsicles > 0 and k = 0: print("give away") else: print("eat them yourself")
7 odpowiedzi
+ 10
= is assignment
you need == for comparison
+ 3
K==0
+ 2
You should try this..
if popsicles % siblings == 0 :
print("give away")
else:
print("eat them yourself")
+ 2
I reached this level and I'm still not getting it, help me out please
siblings = int(input())
popsicles = int(input())
#your code goes here
test = popsicles % siblings
if test == 1:
print("eat them yourself")
if test == 0:
print("give away")
+ 1
Please put k==0
+ 1
siblings = int(input())
popsicles = int(input())
#your code goes here
if siblings>0:
t=popsicles%siblings
if t==1 or t>0.5 :
print("eat them yourself")
elif popsicles == siblings:
print('give away')
elif t%2==0:
print('give away')
else :
print("give away")
else :
print("eat them yourself")
0
Use the module operand "%" Will return 0 if the amount of siblings divided by popsicles is Even
siblings = int(input())
popsicles = int(input())
if popsicles % siblings == 0:
print("give away")
else:
print("eat them yourself")