Random Module In Python | Stone, Paper, Scissors using Python

Publié le: 11 septembre 2020
sur la chaîne: KJ.TUTORIAL
159
10

Introduction To Python Tutorials From Basics To Advance.
For Source code or Slides Visit -
https://sites.google.com/view/kj-tuto...

In this video we will see :
Random module
pip install
stone, paper, scissors game
Code:
import random

a = ["stone", "paper", "scissors"]
b = random.choice(a)

say = int(input("Choose (for stone= 1,for paper=2,for scissors=3) : "))
if say == 1:
user_choice1 = "stone"
print(user_choice1)
elif say == 2:
user_choice2 = "paper"
print(user_choice2)
elif say == 3:
user_choice3 = "scissors"
print(user_choice3)
else:
print("Check what u are doing!!")

if b == "stone" and say == 1:
print("Its tie buddy!!")
elif b == "stone" and say == 2:
print("U won ")
elif b == "stone" and say == 3:
print("U lost ")
elif b == "paper" and say == 1:
print("U lost ")
elif b == "paper" and say == 2:
print("Its tie buddy!")
elif b == "paper" and say == 3:
print("U won ")
elif b == "scissors" and say == 1:
print("U won ")
elif b == "scissors" and say == 2:
print("U lost ")
elif b == "scissors" and say == 3:
print("Its tie")
else:
print("Check what u are doing!!")

print("Computer choose : %s" % b)

In this video learning series we are going to learn Python using real life examples, memes and by solving ample of useful examples.

By the end of this video learning series you will able to built some brain storming games, apps and much more.

See you in the next video !


Credits :

Into video :
Halvorsen - Wouldn't Change It [NCS Release]
Connect with NCS
•   / nocopyrightsounds  
•   / nocopyrightsounds_  
•   / nocopyrightsounds  
•   / ncsounds  
• http://spoti.fi/NCS

Halvorsen
•   / jakobhalvorsen  
•   / halvorsenmusic  

End video -Created by Lynx2D

Jim Yosef - Firefly [NCS Release]
▽ Connect with NCS
Facebook   / nocopyrightsounds  
Twitch   / nocopyrightsounds  
Twitter   / ncsounds  
Spotify http://spoti.fi/NCS
SoundCloud   / nocopyrightsounds  
Google+ http://google.com/+nocopyrightsounds
Instagram   / nocopyrightsounds_  
▽ Follow Jim Yosef
SoundCloud   / jim-yosef  
Facebook   / jimyosefmusic  
YouTube    / jimboows  

THUMBNAIL BACKGROUND = https://www.google.com/search?q=+code...
PYCHARM LOGO - https://www.google.com/search?q=PYCHA...
python logo link = https://www.google.com/search?q=pytho...

#programmer #python #coder #developer


Sur cette page du site, vous pouvez voir la vidéo en ligne Random Module In Python | Stone, Paper, Scissors using Python durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur KJ.TUTORIAL 11 septembre 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 159 fois et il a aimé 10 téléspectateurs. Bon visionnage!