Hello,
I am trying to create a program that has multiple while true statements, each of which are in different functions and have different variables in them. The problem I am, having is at the end of the program I need to be able to call these variables from their functions into another one in order to multiply them. I can't seem to figure out the pieces of code I need to do this. The variables I am trying to call are DAY from the Day() function. YEAR from the Year() function and Month from the bottom while Truew loop. i am trying to call these functions into the Magic() function. Please help. Thank you
def Day():
while True:
D = range(1, 32)
print()
DAY = int(input("Please enter a two digit day. "))
if DAY not in (D):
print()
print("Thats an invalid number. ")
else:
if DAY in range(1,32):
Year()
def Year():
while True:
Y = range(100)
print()
YEAR = int(input("Please enter a two digit year. "))
if YEAR not in (Y):
print()
print("Thats an invalid number. ")
else:
if YEAR in range(100):
print("yep")
Magic()
while True:
M = range(1,13)
print()
Month = int(input("Please enter a month 1 through 12. "))
if Month not in (M):
print()
print("That is not a two digit month")
else:
if Month in range(1,13):
Day()
def Magic():
MAGIC = DAY * Month