Write a code in python to display your name and age.
Answers
Answered by
18
For name:
name = input(""What is your name? "") # displays the message on screen and stores the input from the user in a variable called name
print(""Hi """" +name)
for address:
number = input(""Enter your house number: "")
street = input(""Enter your street name: "")
town = input(""Enter your town/city: "")
county = input(""Enter your county: "")
postcode = input(""Enter your postcode: "")
print(""\nAddress Details:\n"" + ""Street: "" + number + "" "" + street + ""\nTown/City: "" + town + ""\nCounty: "" + county + ""\nPostcode: "" + postcode)
For age:
age = int(input(""Enter your age ""))
if age >= 18:
print(""You are an adult"")
else:
print(""You are still a child"")
Similar questions