0

How to ask for a name and then print it in a sentence?

I want to write a program like this: a=input("Hey! What is your name?\n") print("Hello") a but I don't know the error.

29th Jan 2016, 6:38 PM
Samnit Mehandiratta
Samnit Mehandiratta - avatar
2 Antworten
0
It should look like this: a= input("Hej, what ever...") print("\nHello, ", a)
16th Mar 2016, 10:23 PM
Tomasz Jasiński
Tomasz Jasiński - avatar
0
you could also use concatenation but with a variable name = input() print("Hello " + name) so whatever name you type in will be printed out as input automatically converts to string
22nd Jun 2016, 4:17 PM
Jonathan de Kock
Jonathan de Kock - avatar