Just learning how to code with pycharm. I was trying to make a rock paper scissors game, and kept getting random syntax errors usually relating to quotes. I ended up copying the entire script from the website I was using into pycharm (only like 15 lines), and kept getting the same syntax errors. The site had several reviews at the bottom saying the code was chill and worked for them so I trust (i think) the code. Reinstalled pycharm and python and was still getting the same errors. Any ideas? heres the code:
import random
user_action = input(“Enter a choice (rock, paper, scissors): “)
possible_actions = [“rock”, “paper”, “scissors”]
computer_action = random.choice(possible_actions)
print(f”\nYou chose {user_action}, computer chose {computer_action}.\n”)
if user_action == computer_action:
print(f’Both players selected {user_action}. It’s a tie!’)
elif user_action == “rock”:
if computer_action == “scissors”:
print(“Rock smashes scissors! You win!”)
else:
print(“Paper covers rock! You lose.”)
elif user_action == “paper”:
if computer_action == “rock”:
print(“Paper covers rock! You win!”)
else:
print(“Scissors cuts paper! You lose.”)
elif user_action == “scissors”:
if computer_action == “paper”:
print(“Scissors cuts paper! You win!”)
else:
print(“Rock smashes scissors! You lose.”)