Писал программу для камень ножницы бумага и т.д Сначала все работало прекрасно, а потом перестал выполнять все, что находится в цикле while True код:
import random
bot = 0
you = 0
print('''Привет!Это игра Камень Ножницы Бумага!
Но это расширенная версия) тут есть счёт.
Когда либо у тебя либо у бота набирается 11 очков, то партия заканчивается, и начинается новая.
Всего играем до 2 выигрышных партий.
Нажми Enter чтобы начать.
Удачи!''')
input()
while True:
if you == 11:
print('Партия закончилась в твою пользу!')
partyou += 1
elif partyou == 2:
print('Ты выиграл обе партии!')
if bot == 11:
print('Партия закончлась в пользу бота!')
partbot += 1
elif partbot == 2:
print('Ты проиграл обе партии!')
a = ['Камень','Ножницы','Бумага','Карандаш','Огонь','Вода','Бутылка лимонада','Железная рука']
b = input('Выбери. Камень Ножницы Бумага Карандаш Огонь Вода и Бутылка лимонада и Железная рука: ')
с = (random.choice(a))
rock = 'Камень'
nozj = 'Ножницы'
paper = 'Бумага'
pencil = 'Карандаш'
fire = 'Огонь'
water = 'Вода'
butilka = 'Бутылка лимонада'
iron = 'Железная рука'
win = 'Ты выиграл!'
lose = 'Ты проиграл!'
draw = 'Ничья!'
partyou = 0
partbot = 0
if b == 'Обновить':
bot = bot-bot
you = you-you
print(f'Счёт: {you}:{bot}')
continue
print(f'Твой выбор:{b}, выбор бота:{c}')
#Счёт Очки Партии
#Победа, проигрыш или ничья? А также счёт
#Ничья
if c == b:
print(draw)
elif c == water and b == butilka:
print(draw)
elif c == butilka and b == water:
print(draw)
else:
#Камень
if c == rock and b == nozj:
print(lose)
bot = bot+1
elif c == rock and b == paper:
print(win)
you = you+1
elif c == rock and b == pencil:
print(lose)
bot = bot+1
elif c == rock and b == fire:
print(win)
you = you+1
elif c == rock and b == water:
print(win)
you = you+1
elif c == rock and b == butilka:
print(lose)
bot = bot+1
elif c == rock and b == iron:
print(lose)
bot = bot+1
else:
#Ножницы
if c == nozj and b == rock:
print(win)
you = you+1
elif c == nozj and b == paper:
print(lose)
bot = bot+1
elif c == nozj and b == pencil:
print(lose)
bot = bot+1
elif c == nozj and b == fire:
print(win)
you = you+1
elif c == nozj and b == water:
print(win)
you = you+1
elif c == nozj and b == butilka:
print(lose)
bot = bot+1
elif c == nozj and b == iron:
print(win)
you+1
else:
#Бумага
if c == paper and b == rock:
print(lose)
bot = bot+1
elif c == paper and b == nozj:
print(win)
you = you+1
elif c == paper and b == pencil:
print(win)
you = you+1
elif c == paper and b == fire:
print(win)
you = you+1
elif c == paper and b == water:
print(win)
you = you+1
elif c == paper and b == butilka:
print(win)
you = you+1
elif c == paper and b == iron:
print(win)
you = you+1
else:
#Карандаш
if c == pencil and b == rock:
print(win)
you = you+1
elif c == pencil and b == nozj:
print(win)
you = you+1
elif c == pencil and b == paper:
print(lose)
bot = bot+1
elif c == pencil and b == fire:
print(win)
you = you+1
elif c == pencil and b == water:
print(lose)
bot = bot+1
elif c == pencil and b == butilka:
print(lose)
bot = bot+1
elif c == pencil and b == iron:
print(win)
you = you+1
else:
#Огонь
if c == fire and b == rock:
print(lose)
bot = bot+1
elif c == fire and b == nozj:
print(lose)
bot = bot+1
elif c == fire and b == paper:
print(lose)
bot = bot+1
elif c == fire and b == pencil:
print(lose)
bot = bot+1
elif c == fire and b == water:
print(win)
you = you+1
elif c == fire and b == butilka:
print(win)
you = you+1
elif c == fire and b == iron:
print(lose)
bot = bot+1
else:
#Вода
if c == water and b == rock:
print(lose)
bot = bot+1
elif c == water and b == nozj:
print(lose)
bot = bot+1
elif c == water and b == paper:
print(lose)
bot = bot+1
elif c == water and b == pencil:
print(win)
you = you+1
elif c == water and b == fire:
print(lose)
bot = bot+1
elif c == water and b == iron:
print(lose)
bot = bot+1
else:
#Бутылка лимонада
if c == butilka and b == rock:
print(win)
you = you+1
elif c == butilka and b == nozj:
print(win)
you = you+1
elif c == butilka and b == paper:
print(lose)
bot = bot+1
elif c == butilka and b == pencil:
print(win)
you = you+1
elif c == butilka and b == fire:
print(lose)
bot = bot+1
elif c == butilka and b == iron:
print(lose)
bot = bot+1
else:
#Железная рука
if c == iron and b == rock:
print(win)
you = you+1
elif c == iron and b == nozj:
print(lose)
bot = bot+1
elif c == iron and b == paper:
print(lose)
bot = bot+1
elif c == iron and b == pencil:
print(lose)
bot = bot+1
elif c == iron and b == fire:
print(win)
you = you+1
elif c == iron and b == water:
print(win)
you = you+1
elif c == iron and b == butilka:
print(win)
you = you+1
print(f'''Счёт: {you}:{bot}
Счёт партий: {partyou}:{partbot}''') #Счёт
continue
input()