我在python 3中制作了一个简单的疯狂libs程序,用户输入名词和代词,程序应该打印出用户的输入。TypeError:无法将'builtin_function_or_method'对象隐式转换为str
这里是我的代码:
print ("Welcome to Mad Libs. Please enter a word to fit in the empty space.")
proper_noun = input("One day _________ (Proper Noun)").lower()
ing_verb = input("Was __________ (Verb + ing) to the").lower()
noun1= input("to the _________ (Noun)").lower()
pronoun1 = input("On the way, _____________ (Pronoun)").lower()
noun2 = input("Saw a ________ (Noun).").lower
pronoun2 = input("This was a surprise so ________ (Pronoun)").lower()
verb2 = input("_________ (verb) quickly.").lower()
#Asks user to complete the mad libs
print ("One day " + proper_noun)
print ("Was " + ing_verb + " to the")
print (noun1 + ". " + "On the way,")
print (pronoun1 + " saw a " + noun2 + ".")
print ("This was a surprise")
print ("So " + pronoun2 + " " + verb2 + " quickly.")
收到此错误代码:TypeError: Can't convert 'builtin_function_or_method' object to str implicitly
在此行中:
print (pronoun1 + " saw a " + noun2 + ".")
相当新的蟒蛇,所以我不能完全肯定什么这个错误的意思和如何解决它,有人可以解释这个错误代码给我吗?
哇,完全飞过我,谢谢你指出! –