[Tutor] mistaken about splitting expressions over lines

Jim Mooney cybervigilante at gmail.com
Tue Jun 25 03:48:46 CEST 2013


For some reason I took the impression that you could split expressions
over lines. However, this works:

word = 'spam'
new_word = word + 'eggs'
print(word)

But this is a syntax error:

word = 'spam'
new_word = word +
'eggs'
print(word)

 That's easy to avoid, but what if you're adding five or six very long
things, like some really long strings?

-- 
Jim
Never run on gravel with a lightbulb in your mouth (personal
experience - don't ask.)


More information about the Tutor mailing list