Posts

Showing posts with the label paper

Rock, paper, or scissors.

Game of Rock, paper, or scissors. Should be able to run on any platform that can support the Python interpreter. $ python rps.py or c:/[pythondirectory]> python rps.py rps.py [code] import random import sys def makeYourChoice():     print "Press R for Rock"     print "Press P for Paper"     print "Press S for Scissors"     print "Press Q to quit!"     userChoice = raw_input("What do you want to choose?").lower()          if userChoice == "r":         return "Rock"     if userChoice == "p":         return "Paper"     if userChoice == "s":         return "Scissors"     if userChoice == "q":         sys.exit(0)     else:         makeYourChoice() de...

Rock, paper, or scissors.

Game of Rock, paper, or scissors. Should be able to run on any platform that can support the Python interpreter. $ python rps.py or c:/[pythondirectory]> python rps.py rps.py [code] import random import sys def makeYourChoice():     print "Press R for Rock"     print "Press P for Paper"     print "Press S for Scissors"     print "Press Q to quit!"     userChoice = raw_input("What do you want to choose?").lower()          if userChoice == "r":         return "Rock"     if userChoice == "p":         return "Paper"     if userChoice == "s":         return "Scissors"     if userChoice == "q":         sys.exit(0)     else:      ...