If you're comparing floating-point values for equality, then you're doing it all wrong! I'll show you the RIGHT way to compare floats in Python.
🔥 Learn more about floating-point numbers ➡️ https://davidamos.dev/the-right-way-to-compare-floats-in-python/?utm_source=YouTube&utm_medium=YouTube&utm_source=EYh35NrYkog
⏱️⏱️VIDEO CHAPTERS⏱️⏱️
0:00 - Float Comparison Failures
0:23 - What You'll Learn
0:43 - What Are Floating-Point Numbers?
3:18 - What Numbers Get Rounded When Stored as Floats?
5:42 - How To Compare Floats in Python
🔔 Subscribe for more tips just like this: https://youtube.com/davidamos?sub_confirmation=1
👨🏼🎓 WANT HELP LEARNING PYTHON?
I offer private one-on-one Python coaching. Learn more ⇢ https://davidamos.dev/coaching/
ABOUT ME
Hi! I'm David Amos, a Python educator and author of Python Basics: A Practical Introduction to Python 3. I've worked as a professional programmer for over 8 years and have spent the last 3 years helping thousands of people learn Python and become better Python programmers. I'm also an avid Julia programmer and co-host of the @Talk Julia podcast.
My book ⇢ https://www.amazon.com/Python-Basics-Practical-Introduction/dp/1775093328/
My website ⇢ https://davidamos.dev
#Python #PythonFloats #PythonMath #NumbersInPython