0
Why does it show invalid syntax when I use if in Python???
11 Antworten
+ 4
Share your post
+ 3
Complete python first then you can easily solve this problem
+ 3
Arjun We can't see your code coach codes. So create your code as code bit, then share here.
+ 2
Share your code!
+ 2
Arjun For code coach problems, you don't want give input like this:
siblings = input("enter no of siblings")
popsicles = input("enter no of popsicles")
Just give like it in code coaches for take input:👇
siblings = input()
popsicles = input()
It already gave in code coaches. So you don't need write this.👆
Edit:
== compare values is equal or not.
= assign values to variable.
+ 1
siblings = int(input())
popsicles = int(input())
#your code goes here
siblings = input("enter no of siblings")
popsicles = input("enter no of popsicles")
if (popsicles % siblings = 0):
print("give away")
else:
print("eat yourself")
+ 1
May be you did follow the syntax well
you can go back and go though the normal if syntax and you will find the problem to ur code
or
share ur code here so we can see the problem and tell you ur mistake
0
Posted link of my code
0
Ok thnx
0
It says line 9 invalid syntax
It is the line where I wrote if