当我输入此代码时,切片的工作方式出现错误......它不会让我输入它,而且它总体上不会工作。
verb_1 = raw_input("Enter a word")
verb_2 = verb_1.lower()
verb_2_ending = verb_2[-2:]
if verb_2_ending == "ar":
ar_verb = raw_input("you've chosen an AR verb. What tense would you like")
elif verb_2_ending == "er":
er_verb = raw_input("you've chosen an ER verb. What tense would you like")
else :
ir_verb = raw_input("you've chosen an IR verb. What tense would you like")
if ar_verb == "subjunctive":
subject_1 = raw_input("What is the subject")
elif ar_verb == "present":
subject_2 = raw_input("What is the subject")
else :
subject_3 = raw_input("What is the subject")
产生错误:
Enter a word : hablar
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
TypeError: unsupported operand type(s) for -: 'str' and 'str'