It's been some time but time for another question again. I'm confused about what it means by "token at index 0 is the word quit" I have programmed some of it but I'm not certain about that line so I don't know where to start off. I know I'm getting a type error because the bracket [] has an index of 0 with str which I don't think it correct since that would result in a type error.
Terminate Function:
user = input("Are you sure you want to quit? (Y/y): ")
if user == "Y" or user == "y":
return True
else:
return False```
Main Function:
```def main(str):
command = input()
while len(command):
command.split()
index = str[0]
if "quit" == command & "quit" == index:
if terminate(): #don't repeat functions
print("Goodbye!")
try:
if command == "":
break
except:
print("Enter a command or 'quit' to quit")
main()```
The homework instructions are given for context. Thank you for your time 😄 Of course it's a programming class in college so I'm not going to be given enough time to complete it so I'm asking questions to understand the concept of the problem better.