osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

$s and %d in python


Is there any difference in %d and %s below. I get the same result:

my_name = 'Zed A. Shaw'
my_age = 35 # not a lie
my_height = 74 # inches

print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %s inches tall." % my_height

Let's talk about Zed A. Shaw.
He's 74 inches tall.
He's 74 inches tall.