Py Numbers — Free Python Tutorial
Learn Py Numbers in Python with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Py Numbers in Python with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Py Numbers in Python
Python has three numeric types: int (whole numbers like 5, -3, 1000), float (decimals like 3.14, -0.5, 2.0), and complex (for advanced maths like 3+4j — rarely needed at school level).
Type casting converts one type to another: int("42") converts string "42" to integer 42. float(7) converts integer 7 to float 7.0. str(100) converts integer 100 to string "100". This is essential when reading user input (always comes as string) and doing arithmetic.
Python arithmetic operators: + (add), - (subtract), * (multiply), / (true divide — always returns float), // (floor divide — drops decimal), % (modulo — remainder), ** (power/exponent).
Py Numbers — Syntax
int(x) # convert to integer float(x) # convert to float str(x) # convert to string round(x, n) # round to n decimal places
Learn Py Numbers step by step with Syllab's free interactive Python tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Python course →