擅长:python、mysql、java
<p>我清理了你的代码,让它更像Python。现在就试试:</p>
<pre><code>import random
def getVerb():
level1 = ["(manger)","je mange", "tu manges", "il mange", "elle mange", "nous mangeons", "vous mangez", "ils mangent", "elles mangent"]
level2 = ["(boire)", "je bois", "tu bois", "il boit", "elle boit", "nous buvons", "vous buvez", "ils boivent", "elles boivent"]
blanks = '_' * 8
correctAnswers = 0
randomElement = random.choice(level1)
print(randomElement.split()[0], blanks, level1[0])
ans = input()
while True:
if ans == randomElement.split()[1]:
correctAnswers += 1
print("Nice one!")
print(correctAnswers)
else:
print("Bad luck!")
ans = input()
if __name__ == '__main__':
getVerb()
</code></pre>