Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Membership of collection

📅 2009-Sep-30 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

aList = [1, 2, 3, 4, 5] b = 5 if b in aList: # True if b not in aList: # False