Indentation error


this is in the lesson command line calendar
here is my code

from time import sleep, strftime

calendar = {}

def welcome():
  print("Welcome, ") + USER_FIRST_NAME + "."
  print("The calendar is opening...")
  print "Today is" + strftime("%A %B %d %Y")
  print "Current time is" + strftime("%H %M %S")
  print("What would you like to do?")
def start_calendar():
  start = True
  while start:
    user_choice = raw_input("A to Add, U to Update, V to View, D to Delete, X to Exit: ")
    user_choice = user_choice.upper()
    if user_choice == 'V':
      if len(calendar.keys()) < 1:
        print("calendar is empty")
    elif user_choice == 'U':
      date = raw_input("What date?")
      update = raw_input("Enter the update: ")
      calendar[date] = update
      print("the update is successful")
		elif user_choice == 'A':
      event = raw_input("Enter event: ")
      date = raw_inout("Enter date (MM/DD/YYYY): ")
			if len(date) > 10 or int(date[6:9]) < int(strftime("%Y")):

I suppose I should give three tab for the last line of the code(one for the function, one for the elif then one for if statement itself, why the terminal keep telling me there was an indentation error in the last line of the code(the if statement).


Here I can see a indentation problem with elif == ‘A’ , but it was fine in the lesson. It turned wrong after I copied it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.