大家好,这是我的第一篇文章,我只编了一个星期左右,我的学校老师也不是最擅长解释的东西,所以很好:)我试图编写一个程序这将显示一个单词的定义,然后用户将输入他们认为该单词是什么。如果他们得到它的权利,他们将被授予2分,如果他们得到1个字母错误,那么他们将被给予1分,如果超过1信是错误的,那么他们会得到0分。在将来用户将不得不登录,但我正在这部分首先工作。任何想法如何让这个工作?Python - 拼写测试
score = score
definition1 = "the round red or green fruit grown on a tree and used in pies"
word1 = "apple"
def spellingtest():
print (definition1)
spellinginput = input ("enter spelling")
if spellinginput == word1
print = ("Well done, you have entered spelling correctly") and score = score+100
编辑:当我运行它,我得到一个无效的语法错误在这条线
if spellinginput == word1
什么问题? – martineau
如果您可以提出更详细的问题,您会得到更好的回复。当你运行代码时会发生什么,结果与你期望的结果有什么不同? –
我已经编辑了一下 –