if (True):
print "This is always displayed.\n\n";
if (False):
print "This is never displayed.\n\n";
score = 1000;
if (score):
print "At least you didn't score zero.\n\n";
if (score >= 250):
print "You scored 250 or more. Decent.\n\n";
if (score >= 500):
print "You scored 500 or more. Nice.\n\n";
if (score >= 1000):
print "You scored 1000 or more. Impressive!\n";
print "Enter your score: ";
score = 1500 #int(raw_input())
if (score >= 1000):
print "You scored 1000 or more. Impressive!\n";
else:
print "You scored less than 1000.\n";
print "Enter your score: ";
score = 1500 #int(raw_input())
if (score >= 1000):
print "You scored 1000 or more. Impressive!\n";
elif (score >= 500):
print "You scored 500 or more. Nice.\n";
elif (score >= 250):
print "You scored 250 or more. Decent.\n";
else:
print "You scored less than 250. Nothing to brag about.\n";
print "Difficulty Levels\n\n";
print "1 - Easy\n";
print "2 - Normal\n";
print "3 - Hard\n\n";
print "Choice: ";
choice = 2 #int(raw_input())
if choice==1:
print "You picked Easy.\n";
elif choice==2:
print "You picked Normal.\n";
elif choice==3:
"You picked Hard.\n";
else:
"You made an illegal choice.\n";
choices = ['y','y','n']
again = 'y'
i = 0
while (again == 'y'):
print "\n**Played an exciting game**";
print "\nDo you want to play again? (y/n): ",
again = choices[i] #raw_input()
i += 1
print "\nOkay, bye.";
choices = ['y','y','n']
i = 0
again = 'y'
while (again == 'y'):
print "\n**Played an exciting game**";
print "\nDo you want to play again? (y/n): ",
again = choices[i] #raw_input()
i += 1
print "\nOkay, bye.";
count = 0;
while (True):
count += 1;
#end loop if count is greater than 10
if (count > 10):
break;
#skip the number 5
if (count == 5):
continue;
print count
print "\tGame Designer's Network\n";
success = False
while not success:
print "\nUsername: ";
username = 'guest' #raw_input()
print "Password: ";
password = 'guest' #raw_input()
if (username == "S.Meier" and password == "civilization"):
print "\nHey, Sid.";
success = True;
elif (username == "S.Miyamoto" and password == "mariobros"):
print "\nWhat's up, Shigeru?";
success = True;
elif (username == "W.Wright" and password == "thesims"):
print "\nHow goes it, Will?";
success = True;
elif (username == "guest" or password == "guest"):
print "\nWelcome, guest.";
success = True;
else:
print "\nYour login failed.";
success = False;
import random
randomNumber = random.random()*100;
#seed random number generator
#generate random number
die = int(randomNumber % 6) + 1; # get a number between 1 and 6
print "You rolled a " , die
import random
secretNumber = int(random.random()*100) % 10 + 1;
tries = 0;
#seed random number generator
# random number between 1 and 100
print "\tWelcome to Guess My Number\n\n";
guesses = [0,1,2,3,4,5,6,7,8,9,10]
i = 0
while True:
print "Enter a guess: ";
guess = guesses[i] #int(raw_input())
i += 1
tries += 1
if (guess > secretNumber):
print "Too high!\n\n";
elif (guess < secretNumber):
print "Too low!\n\n";
else:
print "\nThat's it! You got it in " , tries , " guesses!\n";
break