Mega Code Archive

 
Categories / Python Tutorial / String
 

String formatting is done with the string formatting operator, the percent (%) sign

format = "Hello, %s. %s enough for ya" values = ('world', 'Hot') print format % values k = "uid"  v = "sa"  print "%s=%s" % (k, v)