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.
On this page of the site you can watch the video online Python - Rock, Paper, scissors with a duration of hours minute second in good quality, which was uploaded by the user Viral Shah 09 August 2020, share the link with friends and acquaintances, this video has already been watched 24 times on youtube and it was liked by 1 viewers. Enjoy your viewing!