Basic Python Programming Guide
A beginner-friendly introduction to Python programming.
1. What is Python?
Python is a high-level, easy-to-read programming language used for web development, automation,
data science, cybersecurity, artificial intelligence, and more.
2. Your First Program
print('Hello, World!')
This displays text on the screen.
3. Variables
name = "Christopher"
age = 22
print(name, age)
4. Data Types
str - Text
int - Whole numbers
float - Decimal numbers
bool - True or False
5. User Input
name = input("Enter your name: ")
print("Hello", name)
6. Conditions
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
7. Loops
for i in range(5):
print(i)
8. Functions
def greet(name):
print("Hello", name)
greet("Christopher")
9. Lists
fruits = ["apple", "banana", "orange"]
print(fruits[0])
10. Files
with open("[Link]", "w") as file:
[Link]("Hello World")
Practice Exercises
1. Create a calculator that adds two numbers.
2. Ask the user for their age and determine if they are an adult.
3. Print numbers from 1 to 100 using a loop.
4. Create a list of five favorite movies and display them.
5. Create a function that returns the square of a number.
Next Topics to Learn
• Object-Oriented Programming (OOP)
• Modules and Packages
• Exception Handling
• APIs
• Web Development with Flask/Django
• Automation and Cybersecurity Scripting