给出此错误名称 'Translate_points' 是参数和全局的。计数器不工作。如何使函数工作的结果可供下一个函数读取?
import random
def V1_inputf1(Translate_points):
print(Translate_1,'рандомный глагол')
Infinitive_input=input("введите инфинитив ",)
if Infinitive_input==Infinitive[index_Translate]:
Translate_points += 1
return Translate_points
else:
Translate_points -= 1
return Translate_points
def V2_inputf1(Translate_points):
print(Translate_1,'рандомный глагол')
Past_Simple_input=input("Введите вторую форму ",)
global Translate_points
if Past_Simple_input==Past_Simple[index_Translate]:
Translate_points += 1
return Translate_points
else:
Translate_points -= 1
return Translate_points
def THE_END():
print("______________________________________________________________________________")
print("______________________________________________________________________________")
while Translate_points<15:
Translate = ['гнуть', 'строить', 'золотить', 'одалживать', 'отправлять', 'тратить', 'разгибаться']
Infinitive = ["bend", "build", "gild", "lend", "send", "spend", "unbend"] # Инфинитив
Past_Simple = ["bent", "built", "gilt", "lent", "sent", "spent", "unbent"] # Вторая форма
Participle_2 = ["bent", "built", "gilt", "lent", "sent", "spent", "unbent"] # Третья форма
Translate_1=random.choice(Translate)
print(Translate_1,'рандомный глагол')
index_Translate=Translate.index(Translate_1)
print(Infinitive[index_Translate],'-',Past_Simple[index_Translate],'-',Participle_2[index_Translate])
print(V1_inputf1(Translate_points))
print(V2_inputf1(Translate_points))
THE_END()
print(V2_inputf1(Translate_points))
print(V1_inputf1(Translate_points))
THE_END()