0
Python "invalid syntax" error
I am just starting with Python and trying to write a simple program to count days in months. I receive an error message: File "<string>", line 4 if month == 1: ^ SyntaxError: invalid syntax What seems to be the problem? https://code.sololearn.com/cx6U2P8zywhn/?ref=app
7 Answers
+ 3
Руслан Егоров Problem is on line no 16 there colon (:) is missing
+ 4
Please write this program in Sololearn Playground and share code here.
Problem is here month = int(Input ('Enter number') - 1
here one closing braces ) missing
Руслан Егоров Check this code and understand what you missed.
https://code.sololearn.com/cI6rhgC5gwSx/?ref=app
+ 3
Руслан Егоров Welcome
+ 1
AJ Anant thank you!
However I still get an error message:
if month % 2
^
Invalid syntax
your code seems to work fine, but I can't see the difference
+ 1
AJ Anant nice adding the leap year, wanted to do that after I get my part of the code working right, haha
+ 1
AJ Anant thanks a lot!