Python Basics & Data Types
The foundation of every Python program โ variables, data types, and output.
What is Python?
Python is a high-level, interpreted programming language created by Guido van Rossum in 1991. It emphasizes code readability with its use of indentation. Python is used in web development, data science, artificial intelligence, automation, and more.
Your First Python Program
Every programmer starts here. The print() function displays output to the console.
Welcome to KODO
2026
Python Data Types
Every value in Python has a type. Here are the 4 fundamental types:
| Type | Example | Description |
|---|---|---|
int | 42, -7, 0 | Whole numbers |
float | 3.14, -0.5 | Decimal numbers |
str | "Hello" | Text (in quotes) |
bool | True, False | Boolean logic |
<class 'float'>
<class 'str'>
<class 'bool'>
Knowledge Check โ Module 1 (Q1)
Q1: What does print(type(42)) output?
Knowledge Check โ Module 1 (Q2)
Q2: Which is a valid Python variable name?
Arithmetic Operators
Python can be your calculator. Master the 7 arithmetic operators.
Comparison & Logical Operators
Make decisions by comparing values.
Assignment Operators
Shorthand to modify variables.
String Indexing & Slicing
Access characters and substrings.
If/Elif/Else Statements
Control program flow with conditions.
Loops (For & While)
Automate repetition.
Lists & Dictionaries
Store collections of data.
Functions
Reusable blocks of code.
Practice Exercises
Apply everything from Modules 1-9.
10 Practice Problems
Write functions to: calculate factorial, count vowels, build a calculator, find max in a list, check palindrome, merge dictionaries, guessing game, Fibonacci sequence, remove duplicates, and build a to-do list.