Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
import random options = ["rock","paper","scissors"] userChoice = "" while userChoice not in options: userChoice = raw_input("Do you play rock, paper, or scissors") compChoice = random.choice(options) if userChoice.lower() == "rock": if compChoice == "rock": print "It's a tie!" elif compChoice == "paper": print "You lose!" elif compChoice == "scissors": print "You Win!" if userChoice.lower() == "paper": if compChoice == "paper": print "It's a tie!" elif compChoice == "rock": print "You Win!" elif compChoice == "scissors": print "You Lose!" if userChoice.lower() =="scissors": if compChoice == "scissors": print "It's a tie" elif compChoice == "rock": print "You Lose!" elif compChoice == "paper": print "You Win!"
kieranspython8.py
( around 27 lines python code )
Published By:
kk4675
Published on
2018-07-27T14:13:10Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here