-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonal_details.py
More file actions
43 lines (29 loc) · 1.18 KB
/
Personal_details.py
File metadata and controls
43 lines (29 loc) · 1.18 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
29
30
31
32
33
34
35
36
import datetime
from datetime import datetime
while True:
first_name = ''
last_name = ''
full_name = first_name + last_name
print('What is your first and last name?')
full_name = input()
if full_name != str:
raise ValueError("Please enter a name")
print("Excuse me, what colour are your eyes?")
eye_colour = input()
if eye_colour != str:
raise ValueError("Please input a colour")
print("What is your hair colour?")
hair_colour = input()
if hair_colour != str:
raise ValueError("Please input a colour")
print("And finally, if it isn't too personal a question, what is your age please?")
age = int(input())
if age != int:
raise ValueError("Please enter a number, for example 22")
def birthday(now):
now = datetime.utcnow().year
return int(now) - age
print("Hello, {}!".format(full_name), "Welcome, your age is {}".format(age),
"you have identified as {},".format(gender), "your eye colour is {}".format(eye_colour),
"and your hair colour is {}".format(hair_colour))
print("You said you were {}".format(age), "hence you were born in {}".format(birthday(age)))