I Have NEVER Used Floats Like THIS Before In Python

Amir Ali Hashemi
1 min readJul 18, 2023

Today I learned something new about floats in Python

Did you know that Python has its very own special syntax for defining not a number?

To do this you would use float followed by parentheses and type in “nan” and this will define not a number

value = float("nan")

--

--

Amir Ali Hashemi

I'm an AI student who attempts to find simple explanations for questions and share them with others