написал за несколько минут. не проверял в течении всего времени. запусаю - ошибка. каждый раз, исправляя ее появлялась новая
перемены названы правильно!!
import random
rock = 'rock'
paper = 'paper'
scissors = 'scissors'
pl_win = 'player won'
pc_win = 'player lose'
dr = 'draw'
def play_in(player_choice):
player_choice = input()
print('player:', player_choice)
def play_out(pc_choice):
pc_choice = random.random(paper,rock,scissors)
print('computer:',pc_choice)
print(rock,scissors,paper)
print('print 0 to break')
while True:
play_in(player_choice=input())
play_out(pc_choice=random.random(rock,paper,scissors))
########################### player lose ########################:
if play_in(player_choice=rock) and play_out(pc_choice=paper):
print(pc_win)
if play_in(player_choice=paper) and play_out(pc_choice=scissors):
print(pc_win)
if play_in(player_choice=scissors) and play_out(pc_choice=rock):
print(pc_win)
########################### player won ##############################:
if play_in(player_choice=paper) and play_out(pc_choice=rock):
print(pl_win)
if play_in(player_choice=scissors) and play_out(pc_choice=paper):
print(pl_win)
if play_in(player_choice=rock) and play_out(pc_choice=scissors):
print(pl_win)
########################### draw ##############################:
if play_in(player_choice=paper) and play_out(pc_choice=paper):
print(dr)
if play_in(player_choice=scissors) and play_out(pc_choice=scissors):
print(dr)
if play_in(player_choice=rock) and play_out(pc_choice=rock):
print(dr)
перемены названы правильно!!
import random
rock = 'rock'
paper = 'paper'
scissors = 'scissors'
pl_win = 'player won'
pc_win = 'player lose'
dr = 'draw'
def play_in(player_choice):
player_choice = input()
print('player:', player_choice)
def play_out(pc_choice):
pc_choice = random.random(paper,rock,scissors)
print('computer:',pc_choice)
print(rock,scissors,paper)
print('print 0 to break')
while True:
play_in(player_choice=input())
play_out(pc_choice=random.random(rock,paper,scissors))
########################### player lose ########################:
if play_in(player_choice=rock) and play_out(pc_choice=paper):
print(pc_win)
if play_in(player_choice=paper) and play_out(pc_choice=scissors):
print(pc_win)
if play_in(player_choice=scissors) and play_out(pc_choice=rock):
print(pc_win)
########################### player won ##############################:
if play_in(player_choice=paper) and play_out(pc_choice=rock):
print(pl_win)
if play_in(player_choice=scissors) and play_out(pc_choice=paper):
print(pl_win)
if play_in(player_choice=rock) and play_out(pc_choice=scissors):
print(pl_win)
########################### draw ##############################:
if play_in(player_choice=paper) and play_out(pc_choice=paper):
print(dr)
if play_in(player_choice=scissors) and play_out(pc_choice=scissors):
print(dr)
if play_in(player_choice=rock) and play_out(pc_choice=rock):
print(dr)