Quiz: Python Sets

Instructions

Complete the following exercises and submit your code:

# Python sets
# 1. Write a Python program to create a non empty set and print it.


# 2. Write a Python program to add member in a set.


# 3. Write a Python program to remove item from set.

# Python sets
# 4. Write a Python program to find the length of a set.


# 5. Write a Python program to find maximum and the minimum
# value in a set.


# 6. Write a Python program to create an intersection of sets.

Feedback

  • Is there anything we can help with up to this point? Do you have something to suggest about this chapter? Let us know in the comments below.

3 replies on “Quiz: Python Sets”

hello!
could you please explain the 5th part?
what if I have a mixed set of values (ints and strings and booleans)?
thank you

Hello!
That’s a very good question 🙂
The 5th part implicitly tells that it’s a set of numbers (minimum / maximum).
But in case the set is mixed you might want to use some conditions in your program.
But don’t worry too much about it we will see complex stuff during the actual Front end development course 😉
Keep up the good work!

Leave a Reply