Great post! You can also create a generator by comprehension:
sum(i * i for i in range(100))
for example! You can surround it with parentheses if you want. It's great for heavy operations when you don't need the entire data structure to be generated.
Great post! You can also create a generator by comprehension:
sum(i * i for i in range(100))
for example! You can surround it with parentheses if you want. It's great for heavy operations when you don't need the entire data structure to be generated.
Thank you for adding this! Exploring this now, and this is another great feature😊