I am currently working on a Intro to Pandas and Jupyter activity and I ran into an issue. I am trying to print the following string: ___ was published by ___ in ___.
The following code keeps on changing "in" to a iteration (correct me if that’s the wrong terminology). How can I get it to print the word "in"?
print("row[0] + "was published by" + row[8] + "in" + row[9] + ".")
SyntaxError: unterminated string literal (detected at line 8)
>Solution :
You have unbalanced double quotes:
Try:
print(row[0] + "was published by" + row[8] + "in" + row[9] + ".")
or use f-string:
print(f"{row[0]} was published by {row[8]} in {row[9]}.")