Class 30 — November 7

You are so controlling

While I can go on – I do not repeat myself – Always a new way


Look both ways


Agenda


Want to be a TA next semester


Time to redownload


Problem

links

est la baguette fraiche

dubailte dubailte kesusahan und guaio

umlilo adolebitque und ketel bombolla

umucu di una pantanoso neidr

dans der ketel bouyi und cuire

oog di tritons und kaki di rano

yun di fledermoyz und lingua di chien

viperae foarke und blyn cuc stik

moo fotur und ovlet tis

pre eng viehatys di voimakas guaio

mag un inferno salda bouyi und bombolla

 


Module of the day aid.py


Function rotate( x )

x1 = []

x2 = [ 3 ]

x3 = [ 3, 1, 4, 1, 5, 9 ]

x4 = [ 'p', 'e', 'c', 'u', 'l', 'a', 't', 'i', 'o', 'n', 's' ]

aid.rotate( x1 ) ; print( x1 )

aid.rotate( x2 ) ; print( x2 )

aid.rotate( x3 ) ; print( x3 )

aid.rotate( x4 ) ; print( x4 )

[]

[3]

[9, 3, 1, 4, 1, 5]

['s', 'p', 'e', 'c', 'u', 'l', 'a', 't', 'i', 'o', 'n']


Function rotate_k_times( x, k )

x1 = []

x2 = [ 3 ]

x3 = [ 3, 1, 4, 1, 5, 9 ]

x4 = [ 'p', 'e', 'c', 'u', 'l', 'a', 't', 'i', 'o', 'n', 's' ]

aid.rotate_k_times( x1, 2 ) ; print( x1 )

aid.rotate_k_times( x2, 3 ) ; print( x2 )

aid.rotate_k_times( x3, 4 ) ; print( x3 )

aid.rotate_k_times( x4 ,5 ) ; print( x4 )

[]

[3]

[4, 1, 5, 9, 3, 1]

['t', 'i', 'o', 'n', 's', 'p', 'e', 'c', 'u', 'l', 'a']


Function common( x, y )

x1 = [] ; y1 = []

x2 = [ 3 ] ; y2 = []

x3 = [ 1 ] ; y3 = [ 3, 1, 4 ]

x4 = [ 2, 7, 1, 8, 2, 8, 1, 8 ] ; y4 = [ 2, 8, 4, 5, 9, ]

z = aid.common( x1, y1 ) ; print( z )

z = aid.common( x2, y2 ) ; print( z )

z = aid.common( x3, y3 ) ; print( z )

z = aid.common( x4, y4 ) ; print( z )

[]

[]

[1]

[2, 8, 2, 8, 8]


To do


 


 

 

 
   
   
   
 
  © 2019 Jim Cohoon   Resources from previous semesters are available.