- 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.
9 ответов
+ 3
whatever is inside input() will be printed to the console.
+ 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.
+ 1
Example
Name = input()
print("Welcome")
print(Name)
this will works but in other line
+ 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.
0
Put it is being printed in the wrong order.
0
C S Did you give any input ?
0
C S Did you enter anything in the input prompt ?
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
- 1
Yes, I gave it an input("John").