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.
Auf dieser Seite können Sie das Online-Video Python - Rock, Paper, scissors mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Viral Shah 09 August 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 24 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!