Skip to content

Instantly share code, notes, and snippets.

@pars3c
Last active February 19, 2020 08:37
Show Gist options
  • Save pars3c/971b2446210c8f7ae849fe707360f4ef to your computer and use it in GitHub Desktop.
Save pars3c/971b2446210c8f7ae849fe707360f4ef to your computer and use it in GitHub Desktop.
Dealing with large set patterns
# In case you are wondering about why the range goes to 101, that is because,
# the last argument is where it stops, meaning it will only reach the previous iteration (100).
# For more information check: https://www.geeksforgeeks.org/python-range-function/
our_set = {x for x in range(1, 101)}
print(our_set)
# or the easiest approach for newcomers.
our_set = set()
for x in range(1, 101):
our_set.add(x)
print(our_set)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment