At 11:10 PM 8/22/2006, Bob Gailer wrote:
>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)

Thanks! That's the one I was trying to remember.

>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)

That first line produces the error, "TypeError: int argument 
required". Maybe this is what you meant?:

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

Thanks very much,

Dick Moores



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to