Numbers (int, float)
Python has two main numeric types: integers (whole numbers) and floats (decimal numbers).
Integers (int)
Integers are whole numbers without decimal points:
Loading Python Playground...
Floats
Floats are numbers with decimal points:
Loading Python Playground...
Exercises
Loading Python Exercise...
Loading Python Exercise...
Arithmetic Operations
Loading Python Playground...
Loading Python Exercise...
Loading Python Exercise...
Loading Python Exercise...
Built-in Functions
Loading Python Playground...
Loading Python Exercise...
Integer vs Float Division
Loading Python Playground...
Practice Playground
Loading Python Playground...
Key Takeaways
intfor whole numbers,floatfor decimals- Use underscores for readability:
1_000_000 /always returns float,//returns integer%gives remainder,**is powerabs(),round(),min(),max()are useful built-ins

