Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I was coding i typed name = input('What is your name?'). The output would be What is your name?. Next I want the output to be Hello, whatever the person typed in. But I don't know how.
Posted
Comments
Member 11457065 16-Feb-15 22:36pm    
Really need help with it.

here is your solution..

Python
name = input("What is your name?")
print("hello %s" %name)


%s is for string.. %name is your variable..
if you want integer number at run time then cast your input..
%d is for integer value..
%f for floating value..
 
Share this answer
 
Comments
Member 11457065 17-Feb-15 11:06am    
Thanks!
SagarVirpara 18-Feb-15 9:13am    
any time :)
You can find the answer to this, and other questions, at https://docs.python.org/3.3/tutorial/index.html[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900