0
How come this code has an error?
siblings = int(input()) popsicles = int(input()) #your code goes here if(popsicles / siblings = 0){ print("give away") } else{ print("eat them yourself") } Aparently Popsicles can't be divided by siblings like that, cause it says there's an error
7 ответов
+ 2
Remember that you don´t need to have the same amount of pops and siblings to make the code print "give away", you need the REMAINDER to be 0. That might be a good clue.
Also the remainder should be 0 if you have more popsicles than siblings, or if you have more siblings than popsicles to be able to give them away.
+ 4
Potato it's not Java(you can't use curly brackets)
remove them
+ 4
Potato it should be like this
siblings = int(input())
popsicles = int(input())
#your code goes here
if(popsicles / siblings == 0):
print("give away")
else:
print("eat them yourself")
+ 3
in the fourth line
if(popsicles/siblings=0)
Use (==) for checking equality you have used (=)
+ 2
LOL, no braces in python :)
https://code.sololearn.com/crfeEud14KTX/?ref=app
+ 2
Thanks everyone!
+ 1
Sorry but it didn't work