I'm just beginning to learn python. I'm creating a little rock paper scissors game.
Line 8 seems to be my problem ("def rock_logic():"). The VS studio code debugger says "invalid syntax (, line 8)pylint(syntax-error)"
I've looked through both Automate the boring things and Colts Steele's "The Modern Python 3 Bootcamp," but I can't seem to find the solution.
import random
choices = ['rock', 'paper', 'scissors']
user_choice = input()
comp_choice = random.choices()
print("ROCK! PAPER! SCISSORS!")
def rock_logic():
if user_choice = 'rock' and comp_choice = 'rock':
print ('TIE')
elif user_choice = 'rock' and comp_choice = 'paper':
print('YOU LOSE')
else:
print('WINNER WINNER CHICKEN DINNER')
def paper_logic():
if user_choice = 'paper' and comp_choice = 'paper':
print ('TIE')
elif user_choice = 'paper' and comp_choice = 'scissors':
print('YOU LOSE')
else:
print('WINNER WINNER CHICKEN DINNER')
def scissors_logic():
if user_choice = 'scissors' and comp_choice = 'scissors':
print ('TIE')
elif user_choice = 'scissors' and comp_choice = 'rock':
print('YOU LOSE')
else:
print('WINNER WINNER CHICKEN DINNER')
Aucun commentaire:
Enregistrer un commentaire