0

Completely new to coding and this site, so I know this is going to seem like a silly or extremely obvious question. I've tried looking on the site for answers, but I don't know if the answers already given would work on this, or I simply don't know how to input the answers given into my code.

I want the "years old" print to appear right after you input the age, but on the same line.

name = input ("Hello, my name is ")
age = input("I am ")
print ("years old")
job = input("I am a ")
izhang05
  • 744
  • 2
  • 11
  • 26
PJS
  • 1

2 Answers2

0

Maybe you want something like this:

name = input("Enter your name : ")
age = input("Enter your age : ")

print(f"My name is {name} and I am {age} years old")
Elgin Cahangirov
  • 1,932
  • 4
  • 24
  • 45
0

Try something like

name = input ("Name: ")
age = input("Age: ")
print ("Hello, My name is {}, I am {} years old".format(name, age))
Rajat Singh
  • 300
  • 2
  • 8