# An introduction to variable declarations number = 7 # no need of declaration of variable. Python is dynamically-typed language print "There are %d days in a week."%number
There are 7 days in a week.
# A simple program with two declarations minutes = 60 hours = 24 print "There are %d minutes in an hour."%minutes print "And %d hours in a day."%hours
There are 60 minutes in an hour. And 24 hours in a day.
# prints values of two variables dozens = 17 units = dozens * 12 print "%d units is equivalent to %d dozen."%(units,dozens)
204 units is equivalent to 17 dozen.