#!/usr/bin/env python # q&d examples of two simple functions with parameters # and how to call them # # written by e.bonakdarian sept 2010 # def greeting(dude): # print a simple greeting print 'Yo ', dude, '!' def profile(age, iq): # displays the age and iq print 'You are %d old and your iq is %d' % (age, iq) # our "main" program starts here .... print 'Example of calls to "profile" function.' # examples of calling the Profile function profile(31, 149) # calling the function with numberic literals profile(120, 50) # order matters!! print '\n\nExample of calls to "greeting" function.' greeting('bob') # calling with a string literal name = 'steve' greeting(name) # calling with a variable (that has been initialized # with a string before raw_input('\n to exit.')