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.
Nesta página do site você pode assistir ao vídeo on-line Python - Rock, Paper, scissors duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Viral Shah 09 Agosto 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 24 vezes e gostou 1 espectadores. Boa visualização!