0

Why does it show invalid syntax when I use if in Python???

28th Sep 2020, 8:34 AM
Arjun
Arjun - avatar
11 Réponses
+ 4
Share your post
28th Sep 2020, 8:42 AM
Coder Kay
Coder Kay - avatar
+ 3
Complete python first then you can easily solve this problem
28th Sep 2020, 8:48 AM
Coder Kay
Coder Kay - avatar
+ 3
Arjun We can't see your code coach codes. So create your code as code bit, then share here.
28th Sep 2020, 8:49 AM
Vadivelan
+ 2
Share your code!
28th Sep 2020, 8:37 AM
Vadivelan
+ 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.
28th Sep 2020, 9:01 AM
Vadivelan
+ 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")
28th Sep 2020, 8:54 AM
Arjun
Arjun - avatar
+ 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
29th Sep 2020, 2:45 PM
Tim Don👨🏾‍💻🤟
Tim Don👨🏾‍💻🤟 - avatar
0
Posted link of my code
28th Sep 2020, 8:40 AM
Arjun
Arjun - avatar
28th Sep 2020, 8:46 AM
Arjun
Arjun - avatar
0
Ok thnx
28th Sep 2020, 8:50 AM
Arjun
Arjun - avatar
0
It says line 9 invalid syntax It is the line where I wrote if
28th Sep 2020, 9:11 AM
Arjun
Arjun - avatar