Python Forum

Full Version: Syntax error?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Please, fix the indentation and also post full traceback in error tags
(Oct-02-2020, 01:07 PM)buran Wrote: [ -> ]Please, fix the indentation and also post full traceback in error tags
I don't understand what you mean "fix the indentation"
(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.
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?"))
Lesson - when the interpreter says an error is in a particular line, you need to look also at the line above it.