Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Membership of collection

📅 2009-Sep-30 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ collections, membership, python ⬩ 📚 Archive

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


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧