Guest User

Untitled

a guest
Nov 20th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. def codeChecker(code, wetland_type):
  2. match_dict = {'ay': ['LOBA', 'LOFP'],
  3. 'bg': ['LEBA', 'LEFP', 'LEFR', 'TEBA', 'TEFL', 'TEFR', 'TESL']}
  4. if wetland_type not in match_dict[code]:
  5. return code
  6. else:
  7. return 'No error'
  8.  
  9. codeChecker('ay', 'LOBA') # wetland type in allowable values
  10. # returns 'No error'
  11. codeChecker('ay', 'TEBA') # wetland type outside of allowable values
  12. # returns 'ay'
Advertisement
Add Comment
Please, Sign In to add comment