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

Veröffentlicht am: 11 September 2020
auf dem Kanal: 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


Auf dieser Seite können Sie das Online-Video Random Module In Python | Stone, Paper, Scissors using Python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer KJ.TUTORIAL 11 September 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 159 Mal angesehen und es wurde von 10 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!