vivis vivis avatar dev

> thoughts on AI, code, and everything in between

Notes tagged "#python"

8 notes filed under this tag.

text

#python sets are useful when you need: - fast membership testing - deduplication or uniqueness guarantees - comparing two sets of items

text

#python list tips: - reversed(list) is more memory efficient for reversing a list than slicing list[::-1] because it returns an iterator instead of a copy - You can remove multiple items with slice assignment using list[1:4] = [] or del a[1:4]

text

#python variable scoping can be confusing if you’re used to other programming languages. A scope determines where a variable name is visible, and it’s lifetime. Python checks for the variable definition in the following order, and stops at the first match

link

It’s been a fun July writing Python Koans, I’m hoping to carry this momentum for the rest of the year! If you have suggestions or topics you want me to cover, feel free to DM me! #python pythonkoans.substack.com

Python Koans | Vivis Dev | Substack pythonkoans.substack.com / https://pythonkoans.substack.com Python lessons wrapped in koans. Small puzzles, deep truths. Not your usual tutorial thread. Click to read Python Koans, by Vivis Dev, a Substack publication with hundreds of subscribers.