105k views
1 vote
I need someone to write a code to ask a person his name and age then say hi and his name and age so in the ned there is (hi alex your age is 15) for example

also don't forget to take a screenshot of the code ​

User Nobu
by
7.8k points

1 Answer

2 votes

Answer:

Here's a Python code that will do what you described:

name = input("What is your name? ")

age = input("What is your age? ")

print("Hi " + name + ", your age is " + age + "!")

When you run this code, it will ask the user to input their name and age. It will then use those inputs to print a message that says "Hi [name], your age is [age]!" For example, if the user entered the name "Alex" and the age "15", the output would be:

What is your name? Alex

What is your age? 15

Hi Alex, your age is 15!

Step-by-step explanation:

User Hosna
by
8.7k points

No related questions found