Python Forum
Adding second message to simple loop error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Adding second message to simple loop error (/thread-25635.html)



Adding second message to simple loop error - PythonGainz - Apr-06-2020

Hello there,

hope I'm posting correctly this time.

So the loop works nicely for the first statement, but I'm getting a syntax error for the second one (ending\n)

This is what the console says:
Error:
SyntaxError: invalid syntax


magicians=["alice", "david","carolina"]
for magician in magicians:
    print(magician.title() + ", that was a great trick!"
    print("I can't wait to see your next trick," + magician.title() + ".\n")
As always, many thanks, you guys are great!


RE: Adding second message to simple loop error - Mateusz - Apr-06-2020

Missed ')'
print(magician.title() + ", that was a great trick!")



RE: Adding second message to simple loop error - PythonGainz - Apr-06-2020

Omg, I feel like such an idiot Doh