Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • \$\begingroup\$ [d.pop()for i in range(10)if is_prime(i)] is shorter as for i in range(10):notprime(i)or d.pop(), so it's shorter with a False condition instead of a True one if the condition can be squished into the or. Obviously, if you need the popped values the comprehension is shorter, but this post is about side effects. \$\endgroup\$ Commented Jul 4, 2021 at 22:11