Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if any('a','b','c') in ['b','x','y','z']:
- #now i want to assign the matched 'b' to a variable concisely.
- #In case of multiple matches , any match/ first match may be assigned
- lst = ['b','x','y','z']
- if 'a' in lst:
- var = 'a'
- elif 'b' in lst"
- var = 'b'
- # and so on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement