I have a strange issue in python (3.6.1):
a = 3
f"""a= {a}""" # works
But this does not on the Cloudera Data Science Workbench (a unix system):
f"""a=
{a}""" # error
Engine, line 1
"
^
SyntaxError: EOL while scanning string literal
On Windows I cannot recreate the problem and it did not use to be a problem on CDSW either. Has anyone had a similar problem or could point me towards what might cause such a problem?
Interestingly, this also works:
(f"""a=
{a}""")
To follow up on the comments:
my_frstring= f"""hello
world {a}"""
for c in my_frstring:print(name(c))
LATIN SMALL LETTER H
LATIN SMALL LETTER E
LATIN SMALL LETTER L
LATIN SMALL LETTER L
LATIN SMALL LETTER O
SPACE
ValueError: no such name
ValueError Traceback (most recent call last)
in engine
----> 1 for c in my_frstring:print(name(c))
ValueError: no such name