Random.choice() | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Random.choice()

Hello, I am making a Rock Paper Scissors game and need to put a random.choice() function, Iā€™m not getting how to use it help!

8th Sep 2018, 3:00 PM
Rachel Barbosa
Rachel Barbosa - avatar
2 Respostas
+ 10
# Pass a list of possible options into it: import random options = ["Rock", "Paper", "Scissors"] for _ in range(10): print(random.choice(options))
8th Sep 2018, 3:03 PM
Burey
Burey - avatar
8th Sep 2018, 3:04 PM
Steven M
Steven M - avatar