Day 26 of 100 Days of Python
Practising DSA
Today I started with Sets Data Structures.
1
2
3
4
5
r_scans = ["Alice", "Bob", "Alice", "Charlie", "Bob", "David"]
unique_attendance = set(r_scans)
print("Eve" in unique_attendance)
print(unique_attendance)
Output:
1
2
False
{'David', 'Bob', 'Charlie', 'Alice'}
This post is licensed under CC BY 4.0 by the author.