Feb-28-2022, 12:29 AM
(This post was last modified: Feb-28-2022, 12:31 AM by deanhystad.)
Please post entire error trace.
You get an error because computer_action is an integer, not a GameAction.
You get an error because computer_action is an integer, not a GameAction.
from enum import IntEnum class GameAction(IntEnum): Piedra = 0 Papel = 1 Tijeras = 2 Lagarto = 3 Spock = 4 x = 1 y = GameAction(x) print(x, y)
Output:1 GameAction.Papel
x is an int, y is a GameAction. You need to convert the computed computer_action from int to a GameAction.