Beginner’s Programming Module using
Python
1. Introduction
Welcome to the beginner’s programming module using Python! This module is designed for
those who are new to coding and want to learn the basics of programming using Python—a
language known for its simplicity and readability.
2. Learning Objectives
By the end of this module, you will be able to:
1. 1. Understand basic programming concepts.
2. 2. Write simple Python programs.
3. 3. Use variables, data types, and control structures.
4. 4. Debug and run Python code.
3. Getting Started with Python
Python can be installed from https://www.python.org. You can also code online using
platforms like Replit or Google Colab.
4. Writing Your First Program
Let’s start with a simple program:
# This is your first Python program
print("Hello, world!")
5. Variables and Data Types
Variables store data. Python has different types of data:
# Example:
name = "Alice" # String
age = 25 # Integer
height = 5.5 # Float
is_student = True # Boolean
6. Control Structures
Conditional Statements:
age = 18
if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
Loops:
# While loop
count = 0
while count < 5:
print("Count:", count)
count += 1
# For loop
for i in range(5):
print("Number:", i)
7. Practice Exercises
1. Write a program that asks for your name and age, then prints a greeting.
2. Create a loop that prints the numbers from 1 to 10.
3. Write a program that checks if a number is even or odd.
8. Summary
You’ve learned the basics of Python including how to write a program, use variables, and
control the flow of your program using conditions and loops. Keep practicing to build your
skills!