Class 29 — November 4

You are so controlling

Working Together – Structured Collaboration – New understanding

A happy birthday — To my dear sister Kathleen — Best wishes to you


Look both ways


Agenda


Slide downloads


Module self-testing downloads


Homework downloads


if ( __name__ == '__main__' ) statement

def f() :

  print( "Function f() was invoked" )

if ( __name__ == '__main__' ) :

  f()

import module_with_program_run_code

print( "Nothing special happened" )

Function f() was invoked

Nothing special happened

if ( __name__ == '__main__' ): # __name__ is a built in python variable.

  import abet # it is set to __main__ if you are running

  # that module as a program

  # it is set to the name of the module

  # if it is being imported

  abet.test_rotate()

  abet.test_rotate_k_times()

  abet.test_common()



Parameter passing nuances


Module of the day aid.py

Function rotate( x )


Function rotate_k_times( x, k )


Function common( x, y )


To do


kmc in 1999

 


 

 

 
   
   
   
 
  © 2019 Jim Cohoon   Resources from previous semesters are available.