yea, this is long.. but how do i make this repeat?
At the end it's suppose to ask "do you want to do this again, y for yes, n for no" where yes is repeat from the beginning and no is exit. I think i messed it up............................ someone help?
import random
print "Number of the day:"
print
def dieroll():
randomnumber = random.randrange(100)+1
return randomnumber
def add2dieroll():
y = dieroll() + dieroll()
return y
#main
z= add2dieroll()
print dieroll(), "+", dieroll(), "= [", z, "]"
print "-" *35
print
name=raw_input("Hello,what is your name?")
def addyear(x):
x2 = 2009 - x
return x2
#main
print
print "Hello", name
x =input("What year were you born?:")
x2 = addyear(x)
print
print x, "-2009 =", x2
print "cool, you are", x2, "years old"
print
randomquestion=raw_input("so, do you like buying things?")
print
a=raw_input("What are 2 items that you bought this week?:")
def add2sub2(x,y):
x2 = x + 2.05
y2 = y + 2.05
return x2, y2
#main
x = input("how much did it cost ")
y = input("how about the other one?")
print
x2, y2 = add2sub2(x,y)
print x, " + 5%GST + 8%PST = ", x2
print y, " + 5%GST + 8%PST = ", y2
print "the total is: ", "$", x2 + y2
def dieroll():
question=raw_input("Here are some lottery numbers you can use (press enter key):")
for each in range(6):
randomnumber = random.randrange(100)+1
print randomnumber
print
answer = 'y'
while answer == 'y':
dieroll()
answer=raw_input("Do you want new numbers? (y or n)")
print "okay bye"
raw_input("\n\nPress the enter key to exit.")