Syntax error? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Syntax error? (/thread-30057.html) |
Syntax error? - enderfran2006 - Oct-02-2020 Hello I am trying to make a calender on Python but for some reason it is not working. could some one help event = int(input("When is your event?") if event == 1: first = input("What is happening that day?") print("So on the 1st of January it is",first,) if event == 2: second = input("What is happening that day?") print("So on the 2nd of January it is",second,) if event == 3: third = input("What is happening that day?") print("So on the 3rd of January it is",third,)The error says its something to do with the : in if event== 1 RE: Syntax error? - buran - Oct-02-2020 Please, fix the indentation and also post full traceback in error tags RE: Syntax error? - enderfran2006 - Oct-02-2020 (Oct-02-2020, 01:07 PM)buran Wrote: Please, fix the indentation and also post full traceback in error tagsI don't understand what you mean "fix the indentation" RE: Syntax error? - buran - Oct-02-2020 (Oct-02-2020, 01:13 PM)enderfran2006 Wrote: I don't understand what you mean "fix the indentation"lines 3-14 are indented, compared to line 1 when they should not be indented. Note you need to keep the indentation within ine 3-14. RE: Syntax error? - Yoriz - Oct-02-2020 Apart from the indentation the first line event = int(input("When is your event?")has two open brackets and only one close bracket, add another close bracket to the end. event = int(input("When is your event?")) RE: Syntax error? - jefsummers - Oct-02-2020 Lesson - when the interpreter says an error is in a particular line, you need to look also at the line above it. |