Arrgh! Please help.
Courageous
jkraska1 at san.rr.com
Sat May 13 22:29:37 EDT 2000
> for key,value in rv.items():
> oL = oL + value + "&" + "blah"
> WHY???
You didn't say what types your key and value are. You
most likely either need `value` or you need to somehow
sensibly convert value to a string by defining a method
to do athat.
> And while I'm at it, is there any way to use consecutive print
> statements,...
Here's one way:
print "This is a test of the emergency broadcast system\n" \
"This is only a test. Had this been an actual\n" \
"emergency, you would have been given instructions\n" \
"on where to go and what to do.
Here's another way:
print "Guten tag! Ich heisse \"%s\", and ich bin von\n" \
"Dresden. Ich habe %d jaren, und Ich grosse %3.1f\n" \
"kilogramme. Anschildegung. Meine Deustch ist nicht\n" \
"so gut." % ( "Josef", 33, 85.3 )
And yet another way:
print "This is"+" a test"+" of string concatenation, "+ \
"which can be very expensive."
Note that the % operator isn't just for print. For example, you
do thing like:
str = "Hi, my name is \"%s\"" % "Fred"
Joe.
More information about the Python-list
mailing list