Table of Contents
TogglePython is the most widely used language in Machine Learning. In this lesson, you’ll get comfortable with the basics: variables, loops, and functions — the building blocks of your future ML code.
A variable is like a container that stores data. You don’t need to define the data type.
x = 5
name = "John"
price = 99.99
Use for or while loops to repeat actions.
for i in range(3):
print("Hello")
Output: Hello (3 times)
Functions help reuse code blocks with input/output.
def greet(name):
return "Hello " + name
print(greet("Alice"))
Output: Hello Alice
👉 Up next: You’ll set up your first notebook with Jupyter or Google Colab and write real Python code live.
