Mathew K Analytics

Lesson 1 · Data analytics zero to hero

Python Variables & Data Types Explained | Data Analytics #1

Welcome to the first video in a full 30-part series taking you from zero to a job-ready data analyst, entirely in Python. This video covers the absolute…

⬇ Download notebookOpen in Colab ↗

What you'll learn

Data

No separate download needed — the notebook creates or downloads everything it uses.

📓 Full notebook

Download .ipynb

Data Analytics Zero to Hero, Video 1: Variables, Data Types, and Operators#

  • Welcome to the first video in a full 30-part series taking you from zero to a job-ready data analyst, entirely in Python.
  • This video covers the absolute foundation: variables, the core data types, and the operators you'll use in every single video that follows.
  • No prior programming experience needed. Let's jump straight in.

Before You Start#

  • Install Python 3 from python.org (on Windows, check 'Add python.exe to PATH'), then install VS Code from code.visualstudio.com with its Python and Jupyter extensions.
  • Open the Command Palette (Control/Command plus Shift plus P), run 'Create: New Jupyter Notebook', and select your Python interpreter as the kernel.

Part 1: Variables#

age = 28
print(age)
28
age = 29
print(age)
29

Naming Rules#

first_name = 'Ada'
last_name = 'Lovelace'
print(first_name, last_name)
Ada Lovelace

Part 2: Core Data Types#

whole_number = 42
decimal_number = 3.14
text = 'Data Analytics'
is_active = True
print(type(whole_number))
print(type(decimal_number))
print(type(text))
print(type(is_active))
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>

Converting Between Types#

price_text = '19.99'
price_number = float(price_text)
print(price_number)
print(price_number * 2)
print(str(price_number) + ' dollars')
19.99
39.98
19.99 dollars
age_text = str(29)
print(age_text, type(age_text))
29 <class 'str'>

Part 3: Arithmetic Operators#

a = 17
b = 5
print(a + b)
print(a - b)
print(a * b)
print(a / b)
22
12
85
3.4
print(a // b)
print(a % b)
print(a ** 2)
3
2
289

Part 4: Comparison and Logical Operators#

x = 10
y = 20
print(x == y)
print(x != y)
print(x < y)
print(x >= 10)
False
True
True
True
has_ticket = True
has_id = False
print(has_ticket and has_id)
print(has_ticket or has_id)
print(not has_id)
False
True
True

Part 5: Formatting Output with f-strings#

name = 'Priya'
score = 87.456
print(f'{name} scored {score} points')
print(f'{name} scored {score:.1f} points')
Priya scored 87.456 points
Priya scored 87.5 points
revenue = 48213.7
print(f'Total revenue: ${revenue:,.2f}')
Total revenue: $48,213.70

Wrap-Up: What You Learned#

  • Variables: creating them, reassigning them, and Python's snake_case naming convention.
  • The four core data types: int, float, str, and bool, plus converting between them.
  • Arithmetic operators, including floor division and modulo.
  • Comparison operators, which always return a bool, and the and/or/not logical operators.
  • f-strings for embedding variables in text, with precise number formatting.
  • Everything here is the vocabulary the rest of this 30-video series is written in. Subscribe so video two, on control flow, lands in your feed next see you there.

Found this useful?

All lessons, notebooks and datasets here are free. If they helped you, a coffee keeps new lessons coming.