Home / Python Tutorial / Day 1
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:28float— a number with a decimal point:3.5str— text, always in quotes:"Amit"bool—TrueorFalse
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 —
Capital letters matter:
print(Amit) makes Python look for a variable called Amit.
Capital letters matter:
Name and name are two different variables.Try these yourself
- Print your own name.
- Make a variable called city and print it.
- Print your name and city in one print().
- 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 →