Ask coding questions

← Back to all posts
how do you ask the name
petrhejtmanek

what is your name and i want a question and it will reply hello name

Voters
KS-11ZZ-943971
JackMcAllister
Khalidsafe1
Alex069
RussellMooney
AllysonSmith2
petrhejtmanek
Comments
hotnewtop
ash15khng

To ask a question and get the response from the user you can do this:

var is the variable you want to save the text from the user to.
To print a variable with a string you can do this:

Combining these two things gives this:

LyLaAaAa

I need to ask them for their name AND last name but I'm not sure how to do it.

PhilLongden

name = input("What is your name?")
print("Hello",name)