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

16th Mar 2020, 3:39 PM
Руслан Егоров
Руслан Егоров - avatar
7 Answers
+ 3
Руслан Егоров Problem is on line no 16 there colon (:) is missing
16th Mar 2020, 4:04 PM
A͢J
A͢J - avatar
+ 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
16th Mar 2020, 3:44 PM
A͢J
A͢J - avatar
16th Mar 2020, 4:06 PM
A͢J
A͢J - avatar
+ 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
16th Mar 2020, 3:57 PM
Руслан Егоров
Руслан Егоров - avatar
+ 1
AJ Anant nice adding the leap year, wanted to do that after I get my part of the code working right, haha
16th Mar 2020, 4:04 PM
Руслан Егоров
Руслан Егоров - avatar
+ 1
AJ Anant thanks a lot!
16th Mar 2020, 4:06 PM
Руслан Егоров
Руслан Егоров - avatar