Python Slices Part 2: The Deep Cut
In this post we take a deeper dive into Python slices, and pull back the curtain on the magic methods behind the slice notation we covered in earlier posts.
In this post we take a deeper dive into Python slices, and pull back the curtain on the magic methods behind the slice notation we covered in earlier posts.
Slices are amazing whenever you want to use a piece of a larger sequence. Learn the basics of slicing in Python and add a powerful tool to your repertoire.
Take a deep dive into Python's rounding functions! Learn about floor, ceil, trunc, and round, and avoid common rounding errors in Python.
Learn about the some less well-known operators in Python: modulo and floor division—as well as how they interact with each other and how they're related!
Python's and and or keywords can be confusing for beginner programmers, but also for programmers coming from other programming languages. That's because in Python, these operators can behave differently than in other languages! Traditionally, and and or are used to compare true and false values. We do this in English