print "{0} is {1} years old".format("Wilber", 28)
print "{} is {} years old".format("Wilber", 28)
print "Hi, {0}! {0} is {1} years old".format("Wilber", 28)
print "{name} is {age} years old".format(name = "Wilber", age = 28)
li = ["Wilber", 28]
print "{0[0]} is {0[1]} years old".format(li)
print '{:>8}'.format('3.14')
print '{:<8}'.format('3.14')
print '{:^8}'.format('3.14')
print '{:0>8}'.format('3.14')
print '{:a>8}'.format('3.14')
print '{:.4f}'.format(3.1415926)
print '{:0>10.4f}'.format(3.1415926)
print '{:b}'.format(11)
print '{:d}'.format(11)
print '{:o}'.format(11)
print '{:x}'.format(11)
print '{:#x}'.format(11)
print '{:#X}'.format(11)
print '{:,}'.format(15700000000)
近期评论