Created
October 12, 2015 00:17
-
-
Save brez/08e035331ae19435fe42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
players = [] | |
class Players(object): | |
"""create a Player for each user who answers questions in get_guess()""" | |
def __init__(self, name, guess, points): | |
self.name = name | |
self.guess = guess | |
self.points = points | |
def __str__(self): | |
return "%s, has guess: %s and %d points" % (self.name, self.guess, self.points) | |
def get_guess(): | |
"""ask questions to user, set variables from their responses""" | |
name = raw_input("Please enter your name ") | |
guess = raw_input("Who will win Game 1, the Dodgers or the Cardinals?") | |
print "Hello %s, you guessed %s will win Game 1.\nGood Luck!" % (name, guess) | |
players.append(Players(name, guess, 0)) | |
more_players = raw_input("Are there any other players?") | |
while more_players == "yes": | |
name = raw_input("Please enter your name ") | |
guess = raw_input("Who will win Game 1, the Dodgers or the Cardinals?") | |
print "Hello %s, you guessed %s will win Game 1.\nGood Luck!" % (name, guess) | |
players.append(Players(name, guess, 0)) | |
more_players = raw_input("Are there any other players?") | |
get_guess() | |
for player in players: | |
print player |
Author
brez
commented
Oct 12, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment