Jul-04-2018, 08:21 PM
Complete beginner
I don't know how to get the player choice to return the values stored in alpha
I don't know how to get the player choice to return the values stored in alpha
### The idea is to have the player play against the computer without knowing the values of their choices ### then to guess the high middle low choice import random def alpha(*values): alpha.values = values or alpha.values return alpha.values alpha.values =() def bravo(*values): bravo.values = values or bravo.values return bravo.values bravo.values =() alpha(5, 3, 2) a, b, c = alpha() bravo(2, 5, 3) d, e, f = bravo() def choice(): choice = "" while choice != "a" and choice != "b" and choice != "c": print ("choose a, b or c") choice = input() print (choice) return str(choice) def check(choice): compmove = (d, e, f) comp = random.choice (compmove) print (comp) if (choice) == str(comp): print("draw") print (choice) print (comp) elif (choice) > str(comp): print ("player") print (choice) print (comp) elif (choice) < str (comp): print ("comp") print (choice) print (comp) def loop(): guesses = 0 while guesses < 6: move = choice() check(move) guesses = guesses +1 loop()