🚀 New batches open: Advanced Excel • Power BI • SQL • AI for Analytics — Book a free demo

Day 1 — Python print() and variables

Your first lines of Python, running right here in the page. Nothing to install.

print() — how Python talks back

Everything you learn today, you check with print(). It puts a value on the screen.

Change the words between the quotes and press Run again. Nothing breaks — this is your sandbox.

Variables — giving a value a name

A variable is a name pointing at a value. No keyword, no type declaration: just name = value.

Read = as "becomes" age = 28 does not mean "age equals 28" the way it does in maths. It means "put 28 into the box called age". Later you can change it.

The four types you meet first

  • int — a whole number: 28
  • float — a number with a decimal point: 3.5
  • str — text, always in quotes: "Amit"
  • boolTrue or False

Printing several things at once

Separate them with commas and Python puts a space between each.

Comments

Anything after # is ignored. Use it to explain why, not what.

Two mistakes everyone makes on day one Forgetting the quotes around text — print(Amit) makes Python look for a variable called Amit.
Capital letters matter: Name and name are two different variables.

Try these yourself

  1. Print your own name.
  2. Make a variable called city and print it.
  3. Print your name and city in one print().
  4. Use type() to check what type 4.5 is.

Ready for pandas and real projects?

This tutorial covers core Python. Our Data Analytics course takes you into pandas, NumPy, real files and visualisation, with mentor support and portfolio projects.

See the course →