Getting error message in python when I think there is no error

its telling me I need a colon were I already have one

Repl link:

code snippet.
 elif e_v_r == 'edit' or e_v_r == 'Edit':

Hey, @npmomof6 welcome to the forums!
Can you please provide a link to the repl and the full if statement? This way it is easier for staff and members of the community to help you!

2 Likes
print('to do list manager')
to_do_list = []

while True:
  e_v_r = input('do you want to view, add    or edit your to do list? ')
  if e_v_r == 'view' or e_v_r == 'View':
    print(to_do_list)
  elif e_v_r == 'add' or e_v_r == 'Add':
    add = input('what do you want to add? ')
    print(f'you added {add} to your to do list')
  to_do_list.append(add)
  elif e_v_r == 'edit' or e_v_r == 'Edit':
    edit = input('what do you want to remove? ')
    print(f'you removed {edit} from your to do list')
    to_do_list.remove(edit)

The indentation is incorrect for the to_do_list.append(add) line, which is causing the error.

3 Likes

Thank you! That worked! So it didn’t have anything to do with the colon, as the AI was showing.

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