我之前一直在浏览互联网以及之前的其他人,无法找到我继续得到 TypeError:' str'对象不可调用错误每次我尝试运行我的程序,这是为了询问用户回答的问题,然后加上他们的分数,如果我想继续,我需要解决这个问题
input = ("What is your name?")
print = ("I will ask you 10 questions and give you three choices for each question \n IMPORTANT! PLEASE KEEP YOUR CAPSLOCK ON")
score = 0
score = int(score)
q1 = input("What piece of code would show a word/sentence and nothing else \n A. print () \n B. input () \n C. int(print) ")
if q1 == ("A") :
print ("Well done! That is correct")
score = score + 1
print ("Your score is",score,)
elif q1 == ("B") :
print ("That is incorrect")
elif q1 == ("C") :
print ("That is incorrect")
请帮帮我,谢谢!
答案 0 :(得分:5)
input = ("What is your name?")
print = ("I will ask you 10 questions and give you three choices for each question \n IMPORTANT! PLEASE KEEP YOUR CAPSLOCK ON")
使用字符串覆盖input
和print
函数。使用
name = input("What is your name?") # the input will be stored in name
print("""I will ask you 10 questions and give you three choices for each question.
IMPORTANT! PLEASE KEEP YOUR CAPSLOCK ON.""")