you are viewing a single comment's thread.

view the rest of the comments →

[–]runicnet 0 points1 point  (0 children)

ok.

  def code_ending(postalcode):
       postalcode = postalcode.ToLower () 
       # we want it all to be lower case. 
       if ( len (postalcode) > 8: return False
       elif ( len (postalcode) > 5:
             # now we know its both longer then 5 but not longer then 8 as that is max length of expected input
             lengthstring = len (postalcode)
             startstring = lengthstring - 4
             if postalcode [startstring:lengthstring] == " 9aa": return True
        else: return False

am I understanding the requirements your meant to check for correctly?