Introduction To Python - Learn Python the hard way v2.0
Title: Exercise19
# Exercise 19: Functions And Variables

# This is only the function which having two parameters directly i.e. no need to unpack
def cheese_and_crackers(cheese_count, boxes_of_crackers):
    print "you have %d cheese!" % cheese_count
    print "you have %d boxes of crackers"
    print "Man that's enough for party!"
    print "Get a blanket.\n"

print "we can just give the function numbers directly:"
#passing parameters as a digit
cheese_and_crackers(20, 30)

print "OR, we can use variables from our script:"
# here we defining variable and passing that to function
amount_of_cheese = 10
amount_of_crackers = 50
cheese_and_crackers(amount_of_cheese, amount_of_crackers)

print "we can even do math inside too:"
# here we are doing maths to pass parameter
cheese_and_crackers(10 + 20, 5 + 6)

print "And we can combine the two variables and maths:"
# here we are passing parameter as a math of digit and variable
cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000)

# Extra credit

def my_function(first, second, third):
    print "just printing the values came from function call"
    print "this is the first parameter : %r" % first
    print "This is the second parameter : %r" % second
    print "This is the third parameter : %r" % third
    print "This is done"

# passing all parameters as digit
print "function call passing parameters as a digit"
my_function(1, 2, 3)

#passing all parameters as a variables
print "passing parameters as a variable"
one = "one"
two = "two"
three = "three"
my_function(one, two, three)

#passing parameters as a math with variables
one = 1
two = 2
three = 3
print "passing all parameter as math"
my_function(one + 2, two + 2, three + 2)


#passing all the parameter as a math
print "passing all the variables by doing math"
my_function(4 + 2 -1, 4 * 3 + 4, 3 - 3 + 3)


print "finally done with extra credits!! ohhhhhhhh"