Hello, in the interactive interpreter I am entering
name = input("Enter the name") # or name = input('Enter the name')
but I am getting a syntax error on the 2nd quotation mark. Any idea why this is happening?
Thank you,
James
Hello, in the interactive interpreter I am entering
name = input("Enter the name") # or name = input('Enter the name')
but I am getting a syntax error on the 2nd quotation mark. Any idea why this is happening?
Thank you,
James
@jameslooby No spaces/blanks at begin?
@jameslooby Python 2 or 3?
@jameslooby the end quote is not the same as the first one
A long press on the double quote character shows two almost identical characters
name = input("Enter the name”)
^
SyntaxError: EOL while scanning string literal
Note it works correctly if I do not provide the input function with an argument (i.e. a string enclosed in single or double quotes).
Thanks again,
James
No spaces and I am using the same quotes to begin and end argument string although I have also tried them with different open and closed quotes. I will research if my iPad Pythonista app is running 2 or 3
@jameslooby Pythonista left Files, bottom settings
Yes, python 3.6
@jameslooby which syntax error?
SyntaxError: invalid character in identifier with the carat pointing up at the single or double quotes. On the iPad keyboard there are 2 separate single quotes and 2 separate double quotes which throws me off. I believe I have tried every combination. Rather perplexing for a Comp Sci professor :)
@jameslooby Did you try to remove Pythonista from tasks list and restart it?
As you don't have the error without argument, I think it comes from your (double) quotes...
Perhaps an invalid keyboard?
I can't help you, hoping other people could do it with success.
@jameslooby, do you have the Pythonista auxiliary keyboard above the regular keyboard? That has the right (and only the right) quotes for Python.
An EOL ( End of Line ) error indicates that the Python interpreter expected a particular character or set of characters to have occurred in a specific line of code, but that those characters were not found before the end of the line . This results in Python stopping the program execution and throwing a syntax error .
The SyntaxError: EOL while scanning string literal error in python occurs when while scanning a string of a program the python hit the end of the line due to the following reasons:
Strings can't normally span multiple lines. If you don't want the string to appear on multiple lines but you want to initialize it on multiple lines (so you can read it more easily), you can "escape" the newline by putting a backslash before the newline. If you want it to appear on multiple lines, you can use triple quotes around the string.