Cannot get lesson 8 'Interactive Coding Exercise' code to work!

Question: What is wrong with this code

print("Day 1 - Python Print Function
The function is declared like this:
print('what to print')")

Current behavior:

    print("Day 1 - Python Print Function
                                       ^
SyntaxError: EOL while scanning string literal

Desired behavior
To work as shown in the lesson. Also, where is the Submit button?

Repl link:

code snippet

Normal python strings do not span multiple lines. If you want to do this, you should use 3 quotes instead of just 1.

e.g.

print("""Day 1 - Python Print Function
The function is declared like this:
print('what to print')""")
6 Likes

Thanks CodingCatus. That’s good stuff!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.