How To Make a Rock, Paper and Scissors Game | Using Python | Beginners Python Project |

Publié le: 15 juin 2021
sur la chaîne: ProrammingWith Somesh
35
7

Hi guys, in this video I'm going to show you how to make a Rock, Paper and Scissors Game using python. so if you like this video, please Subscribe to my channel for more programming-like content.

#python

Code:-
#RockPaperScissors

import random

def play():
user = input("What is Your Choice. Rock , Paper or Scissors?: ")
computer = random.choice(['Rock', 'paper', 'Scissors'])

if user == computer:
return ("It's a Tie :/")

if is_win(user, computer):
return "You Won ! :)"


return "You Lost :("


def is_win(player, opponent):
if (player == "Rock" and opponent == "Scissors") or (player == "Scissors" and opponent == "paper") \
or (player == "paper" and opponent == "Rock"):
return True

print(play())

Thank You For Watching :)


Sur cette page du site, vous pouvez voir la vidéo en ligne How To Make a Rock, Paper and Scissors Game | Using Python | Beginners Python Project | durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur ProrammingWith Somesh 15 juin 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 35 fois et il a aimé 7 téléspectateurs. Bon visionnage!