Skip to main content

One post tagged with "off-by-one"

View All Tags

What is an Off-by-One Error in Python? (Explained for Kids!)

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Have you ever counted your toys and accidentally said you had 11, but really only had 10? That’s kind of what an off-by-one error is in Python!

It’s a tiny mistake where your program counts 1 too many or 1 too few. These mistakes are super common, even for professional programmers.