0
Why is this not working: y = input ("What is your name")
When I put in my answer, it brings out my answer with the input I put for it
6 Réponses
+ 4
The argument for input function can be a string that will be printed out when the input is asked. If you store the value that the user writes and you passed that argument to input(), the variable will include both the argument and the input:
x = input("what is your name?")
>>>what is your name?
Input is: >>>My name
print(x)
Output is: >>>what is your name?My name
So if you separate the statements in a print("what is yourname?") and input() the user will see the same exact thing but the variable will only store the input of the user:
print("What is your name")
x = input()
>>>What is your name?
input is: >>>My name
print(x)
Output is: >>>My name
+ 2
Try separating the two statements:
print("What is your name?")
y = input()
Here, as there are both different statments, y variable will not include the what is your name, and the result is the same but it does what you want.
+ 1
Kg thanks so much for the advice
+ 1
You are welcome! 😀😀😀
0
Explain more please
0
👌 😊✌