Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Python Refresher: Va | Master Data Science with Python lesso | BraveProgrammer
  1. Courses
  2. /
  3. Master Data Science with Python

Lesson 3 of 60

·python

Python Refresher: Variables, Data Types, and Control Flow

20 minutes

Course progress5%

Python Refresher

Even if you already know Python, a quick recap helps set the stage for data‑science‑specific code.

Variables and Data Types

# Numbers
x = 10          # int
y = 3.14        # float

# Strings
name = "Alice"


is_valid = 


my_list = [, , ]
my_tuple = (, , )
my_dict = {: , : }
# Booleans
True
# Collections
1
2
3
1
2
3
"id"
1
"value"
42

Control Flow

# If‑else
if x > 5:
    print("big")
else:
    print("small")

# Loops
for i in range(5):
    print(i)

while x > 0:
    x -= 1

List comprehensions (the data‑science favorite)

squares = [i**2 for i in range(10)]

Info

Remember: Python is case‑sensitive.
Make it stickPractice what you've learned1 quiz · 4 practical tests · Optional activities from Master Data Science with PythonBrowse activities
Previous lessonJupyter Notebook BasicsContinue to lesson 4Python Functions, Modules, and PackagesBack to Master Data Science with Python curriculum