[Tutor] How to wrap this line of code?

Bob Gailer bgailer at alum.rpi.edu
Wed Aug 23 08:10:31 CEST 2006


Dick Moores wrote:
> I have this long print statement in a script:
>
> print "Initial integer of first sequence with number of terms of %d 
> or more was %s  (%d)" % (length, intCommas(n_for_max_c), n_for_max_c)
>
> It's one line of code, and too long. How can I wrap it so that it is 
> written in the code as 2 lines?
>   
At least either of the following:

print "Initial integer of first sequence with number of terms of %d \
or more was %s  (%d)" % (length, intCommas(n_for_max_c), n_for_max_c)

print "Initial integer of first sequence with number of terms of %d",
print "or more was %s  (%d)" % (length, intCommas(n_for_max_c), n_for_max_c)


-- 
Bob Gailer
510-978-4454



More information about the Tutor mailing list