- 1

Back to front again.

name = input("John") print("Welcome, " + name) Output is: JohnWelcome. Shouldn't it come out as Welcome John? It seems to be coming out back to front.

30th Jan 2022, 9:02 PM
C S
9 Respuestas
+ 3
whatever is inside input() will be printed to the console.
30th Jan 2022, 9:24 PM
Hima
Hima - avatar
+ 3
input() is a function that gets all text up to a new line (from standard input) and returns it as a string as default. You add an argument inside the input function. All this does is act as a prompt to the user. Before input is collected, the promt will be printed to the screen.
30th Jan 2022, 11:13 PM
Slick
Slick - avatar
+ 1
Example Name = input() print("Welcome") print(Name) this will works but in other line
31st Jan 2022, 8:38 AM
Beary
Beary - avatar
+ 1
This is what you want name = input() print("Welcome " + name) If you put something in input, first the input print that statement inside it and after take input.
1st Feb 2022, 9:14 PM
Chandan Maurya
Chandan Maurya - avatar
0
Put it is being printed in the wrong order.
30th Jan 2022, 9:26 PM
C S
0
C S Did you give any input ?
30th Jan 2022, 9:27 PM
Hima
Hima - avatar
0
C S Did you enter anything in the input prompt ?
30th Jan 2022, 9:29 PM
Hima
Hima - avatar
0
what you write inside input(🔹🔹🔹) is the message to tell the user what to type in the input. So something like name = input('Please input your name ') Then what the user inputs will be the value of the variable name
31st Jan 2022, 9:02 AM
Bob_Li
Bob_Li - avatar
- 1
Yes, I gave it an input("John").
30th Jan 2022, 9:28 PM
C S