Skip to content

Instantly share code, notes, and snippets.

@Chaitran77
Forked from anonymous/Eylp-70.py
Created January 21, 2017 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chaitran77/3c606897d8f8834abecdd2a70ad6f206 to your computer and use it in GitHub Desktop.
Save Chaitran77/3c606897d8f8834abecdd2a70ad6f206 to your computer and use it in GitHub Desktop.
null created by chaitran77 - https://repl.it/Eylp/70
from datetime import datetime
def close():
input("\n\nPress the enter key to exit.")
ages = {"age1": 0}
currentyear = datetime.now().year
currentmonth = datetime.now().month
currentday = datetime.now().day
name = input("Hi, lets get to know each other. What is your name?")
born_year = input("What year were you born in?")
born_month = input("What month were you born in (use numbers in the format of: 01 as January or 11 as November) ?")
born_day = input("What day were you born in (use numbers in the format of: 01 as the first or 11 as the 11th)?")
year = int(currentyear) - int(born_year)
month = int(currentmonth) - int(born_month)
day = int(currentday) - int(born_day)
age = str(year) + str(month) + str(day)
str(year)
str(month)
str(day)
end = "You are: " + age[0:2] + " years, " + age[3:4] + " months and " + age[5:6] + " days old..."
print (end)
txt = input("Would you like to save this in a temporary offline database? ONCE THIS PROGRAM IS CLOSED, THE DATA WILL BE REMOVED and IMFORMATION WILL BE PERMENANTLY LOST.")
if txt == "Y":
ages = {"age1": (age)}
index = (ages["age1"])
print("I have saved your age to a temporary database so you can access your age by index using the command 'index'. As soon as you kill this Python process, this data will be PERMENANTLY lost.")
print("Thanks for using my program, " + (name) + ", and I hope you liked it! Bye :-)")
else:
print("Okay then, thanks for using my program, " + (name) + ", and I hope you liked it! Bye :-)")
close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment