I'm running 3.7.4
Type in
v=input("Enter value: ")
print (v)
result:
>>> v=input("Enter value: ")
Enter value: print (v)
It isn't waiting for input.
Per Yoriz, I paste in "v=input("Enter value: ")", type in input, then paste "v=input("Enter value: ")"
Yes, it prints v correctly. It gets the input.
But I'm not clear how this helps me write a script in which I need user input. It doesn't wait. It just moves on to the print command.
Does anyone have something that works for you, that I can paste in to test?
Correction:
Per Yoriz I paste "v=input("Enter value: ")", input, and then "print (v)".
It gets the input, but in a script it doesn't wait, it just moves on to the next command.
I'm brand new to Python. I may have some major misconception about input.
1. It displays the print(v) command but doesn't execute it.
2. When I manually type in the print command, I see it has received the value.
I don't understand. Why doesn't it wait for input and then executes the print command?
>>> v=input("Enter value: ")
Enter value: print (v)hi there
>>> print (v)
print (v)hi there
>>>
I hit Return like every other line of my script, and it all runs. Just not the input command.
What do I do to correct the EOL?
Thanks for reply.
Type in
v=input("Enter value: ")
print (v)
result:
>>> v=input("Enter value: ")
Enter value: print (v)
It isn't waiting for input.
Per Yoriz, I paste in "v=input("Enter value: ")", type in input, then paste "v=input("Enter value: ")"
Yes, it prints v correctly. It gets the input.
But I'm not clear how this helps me write a script in which I need user input. It doesn't wait. It just moves on to the print command.
Does anyone have something that works for you, that I can paste in to test?
Correction:
Per Yoriz I paste "v=input("Enter value: ")", input, and then "print (v)".
It gets the input, but in a script it doesn't wait, it just moves on to the next command.
I'm brand new to Python. I may have some major misconception about input.
1. It displays the print(v) command but doesn't execute it.
2. When I manually type in the print command, I see it has received the value.
I don't understand. Why doesn't it wait for input and then executes the print command?
>>> v=input("Enter value: ")
Enter value: print (v)hi there
>>> print (v)
print (v)hi there
>>>
(Aug-28-2019, 10:16 PM)jefsummers Wrote: The code is correct, but somehow you have a problem with the end of line of the first line. I cut and pasted the code and got an errorwith a big red line going out from the first line.
Error:SyntaxError: multiple statements found while compiling a single statement
Don't know what you did, but somehow in your editing you messed the line ending up.
I hit Return like every other line of my script, and it all runs. Just not the input command.
What do I do to correct the EOL?
Thanks for reply.