Self learning guide for machine learning
Learn the set data structures in python
After completing the exercises below, you should be comfortable with
★☆☆ - Easy
★★☆ - Medium
★★★ - Challenging
★★★★ - Bonus
a = {10,20,30,40,50}
(★☆☆)We will use this list for exercises below
Print out the set and notice the order
Create a Set with 10 random numbers between 1 to 100.
Now create another 10 random numbers, and check if these numbers are in the set.
De-duplicate this list of numbers.
a = [1, 5, 2, 3, 1, 4, 3, 5]
The output should be (in no order)
1, 5, 2, 3, 4
Print unique words from this paragraph.
str = "it was the best of times \
it was the worst of times \
it was the age of wisdom \
it was the age of foolishness \
it was the epoch of belief \
it was the epoch of incredulity \
it was the season of light \
it was the season of darkness \
it was the spring of hope \
it was the winter of despair"
words = str.split()
# list of words.
# Now find the unique words