Python: declare variables and printing
#!/usr/bin/python
my_name = "davinder"
my_age = 35
my_designation = "Lead Architect"
my_weight = 82
my_eyes = "black"
my_hairs = "black"
print "Let's talk about %s." % my_name
print "Let's talk about %d." % my_age
print "My hairs color is %s." % my_hairs
OUTPUT:
#./variables.py
Let's talk about davinder.
Let's talk about 35.
My hairs color is black.
my_name = "davinder"
my_age = 35
my_designation = "Lead Architect"
my_weight = 82
my_eyes = "black"
my_hairs = "black"
print "Let's talk about %s." % my_name
print "Let's talk about %d." % my_age
print "My hairs color is %s." % my_hairs
OUTPUT:
#./variables.py
Let's talk about davinder.
Let's talk about 35.
My hairs color is black.
Comments
Post a Comment