View Single Post
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#25
@fpp

Good call.

@others

And if you decide to use more complex string formatting, don't forget that the variables need to be in a list (comma separated inside parenthesis). For example:
Code:
#! /usr/bin/env python

don = 7
a = 6
b = 8
s = "Q: %03d, what is the speed limit of sex?\nA: %d%d" % (don, a, b)
print s
__________________
N9: Go white or go home
 

The Following 2 Users Say Thank You to daperl For This Useful Post: