Skip to content

Instantly share code, notes, and snippets.

@Sukhrobjon
Last active May 8, 2019 21:12
Show Gist options
  • Select an option

  • Save Sukhrobjon/37a5bebac4c4c92ac8f619c56a72bb46 to your computer and use it in GitHub Desktop.

Select an option

Save Sukhrobjon/37a5bebac4c4c92ac8f619c56a72bb46 to your computer and use it in GitHub Desktop.
# list of number
number_arr = [1, 2, 3, 3, 4, 2]
print(number_arr) # [1, 2, 3, 3, 4, 2]
# we can wrap the same list of numbers in a set
number_set = set([1, 2, 3, 3, 4, 2])
# if we print it returns only distinct numbers
print(number_set) # {1, 2, 3, 4}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment