Home › coding › python › py variables

Py Variables — Free Python Tutorial

Learn Py Variables in Python with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.

✓ 100% Free ✓ No Login Needed ✓ NCERT / CBSE Aligned ✓ Download as PDF

TL;DR: Learn Py Variables 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 Jul 14, 2026

🤖 Stuck on any question? Ask Syllab's free AI Tutor for a step-by-step explanation — instant, unlimited, no login.

Py Variables in Python

A variable is a named container that stores a value in memory. In Python, you create a variable simply by assigning a value to a name — no declaration like int x = 0 needed!

Python has 5 core data types: int (whole numbers), float (decimals), str (text), bool (True/False), and NoneType (no value). Python automatically detects which type you need.

You can check or convert types using built-in functions: type(), int(), float(), str(), bool(). Type conversion is useful when reading user input (which is always a string) and doing math.

Py Variables — Syntax

x = 10           # int
y = 3.14         # float
name = "Priya"   # str
flag = True      # bool (capital T/F!)
nothing = None   # NoneType

Learn Py Variables 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 →

Explore:

  • Syllabus
  • Practice
  • Mock Tests
  • NCERT Solutions
  • Coding
  • GK Quiz
  • Career Predictor
  • AI Tutor
  • Live Quiz
  • Doubt Solver
  • Microlearning
  • Free Alternatives
  • Kids Zone
  • Study Room
  • Calculators
  • Worksheets

Syllab.in — Free learning for Indian students, Class 1–12