>>
>>5140
Hey, I'm currently learning python too, the two best resources I know of that are available for free are w3 schools and codeacademy, they're both great for learning.
On another note, was wondering if anyone could give me a hand, I'm trying to make it so that the variables "name" "year" and "age" are logged in a text file, with a timestamp of when they where saved.
name = input("Please enter your name: ")
year = int(input("Please input the year that you were born: "))
age = 2018 - year
#print(age)
while age == 0:
x = int(input("Age is incorrect, please try again."))
age = 0
age += x
else:
print("Hello ",name,", you were born in the year ",year,)
print("I predict that you are ",age," years old.")
ageright = input("Is this correct? Press y or n to decide.")
if ageright == "y":
print("Fantastic!")
if ageright == "n":
age -= 1
print("Oops! You must be ",age," years old instead!")
fact = input("Press Y for an interesting fact about your age: ")
if fact == "y":
print("Since most humans sleep for about a third of their life, that means that you have slept for a total of ",age/3," years.")
else:
print("Thank you for using the program.")