python his 2fher

Solutions on MaxInterview for python his 2fher by the best coders in the world

showing results for - "python his 2fher"
Jonah
13 Oct 2016
1def user_info():
2    name = input("Name = ")
3    try:
4        age = int(input("Age = "))
5    except ValueError:
6        exit("Invalid value! Age can only be a numerical value!")
7    color = input("Favorite Colour = ")
8    gender = input("Gender = ")
9    if gender is ["Male", "male", "M", "m"]:
10        his_her = "his"
11    elif gender is ["Female", "female", "F", "f"]:
12        his_her = "her"
13    print(f"{name} is {age} years old and {his_her} favorite colour is {color}.")
14
15
16user_info()
similar questions
queries leading to this page
python his 2fher