Python Warmup Practice Functions
<p>Jun 25, 2012 11:16 AM
 
to get into  function definiton editor, hit CONTROL N  (for NEW)
 
def hello():        note the colon after the arg list
    print 'hello world'  note the indentation before print;  note, no punctuation to end it.
 
then hit F5 to return to IDLE Interpreter
 
*
 
def sumo(n):
    total=0
    while i in range(1,n) :   note that range generates the integer list from 1 THRU n-1 (ie n is NOT included)
        total=total+i
        print (i, total)
 
*
def sean (a,b):   note colon
    c = ab     a to the b;  note  only punctuation is the INDENT supplied automatically by IDLE.
    print c     hit F5 key to return to IDLE interpreter and then to run it by typing  sean(3,5) for example</p>