here2share

# string_index.py

Jan 21st, 2021
541
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # string_index.py
  2.  
  3. LLL = ['zero', 'one', 'two', 'three', 'four', 'five']
  4.  
  5. def fn(s): return LLL.index(s) if s in LLL else '!!! *'+s+'* Not Found In List'
  6.  
  7. print(fn("three"))
  8. print(fn("ten"))
  9. print(fn("two"))
RAW Paste Data