-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter Input
More file actions
28 lines (24 loc) · 1.02 KB
/
Character Input
File metadata and controls
28 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Create a program that asks the user to enter their name and their age. Print out a message addressed to them that tells them the year that they will turn 100 years old.
# This App tells the year you are gonna be 100 years old
# This part is the part that tells the date of today
from datetime import datetime
now = datetime.now()
current_year = now.year
current_month = now.month
current_day = now.day
# This part is the personal input part
name = input(" what is your name?\t")
while not (name.isalpha()):
print("please try again")
name =input("What is your name?\t")
print(" your name is " + name)
age = input(" what\'s your age?\t")
while not (age.isdigit()):
print(" please try again")
age = input(" what\'s your age?\t")
print('your age is ' +age)
# The part of naming and age ends here then we move to persons aging part
year = str((current_year - int(age)) + 100)
birthyear = str( current_year - int(age))
print( name + " your birth year is " + birthyear)
print( "and you will be 100 years old in the year " + year)