Python Forum

Full Version: Adding second message to simple loop error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
Missed ')'
print(magician.title() + ", that was a great trick!")
Omg, I feel like such an idiot Doh