Hey guys
I've been studying Python for a short time and I came across this challenge:
Create a jokenpo game
I'm using the random module to select the variables, but I'm having this error in Visual Studio Code
:
File "c:\Users\graff\OneDrive\Area de Trabalho\SCRIPT_PYTHON\Jokepo\main.py", line 6, in
machine=random.Random(variable)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\graff\AppData\Local\Programs\Python\Python312\Lib\random.py", line 132, in init
self.seed(x)
File "C:\Users\graff\AppData\Local\Programs\Python\Python312\Lib\random.py", line 167, in seed
raise TypeError('The only supported seed types are: None,\n'
TypeError: The only supported seed types are: None,
int, float, str, bytes, and bytearray.
Here is the code, thanks in advance to anyone who can help me
import random
variable="rock", "paper", "scissors"
machine=random.Random(variable)
print("Welcome")
print("Choose between Rock, Paper or Scissors")
whileTrue:
guess=(input("Enter your guess: "))
if guess<machine:
print("Try Again!")
elif guess>machine:
print("Try Again!")
else:
print("Congratulations, you win!!!")
break
Top comments (0)