Class 21 – Monday March 4

You are so controlling

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


Look both ways


Agenda


To be considered

Enter (yes / no): yeah

Enter (yes / no): yeap

Enter (yes / no): tá

Enter (yes / no): כן

Enter (yes / no): ndiyo

Enter (yes / no): haan

Enter (yes / no): YeS

yes

Enter (yes / no): nah

Enter (yes / no): không

Enter (yes / no): nope

Enter (yes / no): aʻole

Enter (yes / no): ei

Enter (yes / no): NO

no


Whiling away

while ( test expression ) :

  action

looking_for_a_yes_or_no = True

while ( looking_for_a_yes_or_no ) :

  reply = input( 'Enter (yes / no): ' )

  reply = reply.lower()

  if ( reply in [ 'yes', 'no' ] ) :

  looking_for_a_yes_or_no = False

print( reply )

while ( test expression ) :

  action

else :

  action


Program guess_what.py


Program even_odd.py


Program que_dijiste.py

Problems


To do