Skip to content

(Lab) Dicts, Sets, and Tuples #8

@aguiar-rogerio

Description

@aguiar-rogerio

Congrats, Rodrigo!

You have gone above and beyond in the three challenges. Please, review the topics bellow on the challenge-2.

Sets

  • In the challenge-2, you were required to create a list with 80 random values that should be between 0 and 100 using random.sample. To do that, you have written the following piece of code: random.sample(range(100),k=80). Please, keep in mind that range(100) creates a list that goes from 0 up to 99 instead of up to 100.
  • To check if an element of a set isn't present in another set, you can use the .difference() method.
  • To check if an element of a set is also an element of another set, you can use the .intersection() method.
  • When you are checking if a set is a subset of another, you have misunderstood the order of the sets in the function. Instead of writing set1.issubset(set3), you should have written set3.issubset(set1). Let me know if you have any questions about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Great WorkYou have done a great work! There are no issues to fix.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions