This video is all about rock paper, scissors. Please like if you liked the video, dislike if you didn't and be sure to hit that subscribe button and turn on bell notifications so you don't miss a video.
Code:
import random
def pick():
choices = ["rock", "paper", "scissors"]
computer_choice = choices[random.randint(0,2)]
player_choice = input("Please pick, rock, paper, or scissors: ").lower()
if player_choice in ["rock", "r"]:
if computer_choice == "rock":
print("You picked rock, computer picked rock, you tied.")
elif computer_choice == "scissors":
print("You picked rock, computer picked scissors, you win")
elif computer_choice == "paper":
print("You picked rock, computer picked paper, you lose.")
elif player_choice in ["paper", "p"]:
if computer_choice == "rock":
print("You picked paper, computer picked rock, you win")
elif computer_choice == "paper":
print("You picked paper, computer picked paper, you tied.")
elif computer_choice == "scissors":
print("You picked paper, computer picked scissors, you lose")
elif player_choice in ["scissors", "s"]:
if computer_choice == "rock":
print("You picked scissors, computer picked rock, you lose.")
elif computer_choice == "paper":
print("You picked scissors, computer picked paper, you win")
elif computer_choice == "scissors":
print("You picked scissors, computer picked scissors, you tied.")
play_again = input("Do you want to play again? (y/n): ").lower()
if play_again in ["y", "yes"]:
pick()
elif play_again in ["n", "no"]:
print("Bye")
quit()
pick()
Thank you for watching and I will see you in the next video.
En esta página del sitio puede ver el video en línea Python - Rock, Paper, scissors de Duración hora minuto segunda en buena calidad , que subió el usuario Viral Shah 09 agosto 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 24 veces y le gustó 1 a los espectadores. Disfruta viendo!