BT1IT Python
nadia
Ahmadhanna
nadia Serhan
Chapter 1
Introduc�on to Python and Computer
� Module 1: Introduc�on to Python and Computer Programming
1.1 What is Programming?
Defini�on:
Programming is the process of wri�ng instruc�ons that a computer can understand and execute to perform a
specific task.
Key ideas:
• Programs are writen in programming languages like Python, C, or Java.
• A program is made of commands that tell the computer what to do and how to do it.
• The person who writes programs is called a programmer or developer.
Example analogy:
Programming is like wri�ng a recipe for a computer to follow.
Mini Exercise:
Think of a daily ac�vity (like making tea). Write 3 simple steps as if you were giving instruc�ons to a computer.
1.2 Why Python?
Python is a popular, beginner-friendly language known for its simplicity and versa�lity.
Advantages:
• � Easy to learn and read (uses plain English-like syntax)
• � Free and open source
• � Works on all pla�orms (Windows, macOS, Linux)
• � Widely used in web development, data analysis, AI, and automa�on
1
BT1IT Python Ahmad Serhan
Example comparison:
Language Print Example
Java [Link]("Hello World");
C prin�("Hello World");
Python print("Hello World") � (simpler)
1.3 Python Installa�on and Setup
Steps:
1. Go to htps://[Link]/downloads/.
2. Download the latest version for your opera�ng system.
3. Run the installer and check “Add Python to PATH”.
4. Open a terminal or command prompt and type:
5. python --version
You should see something like:
Python 3.12.2
1.4 Basic Syntax and Hello World
Rules:
• Python files end with .py
e.g., [Link]
• Python uses indenta�on (spaces or tabs) to structure code — no curly braces {}.
• Statements are writen line by line.
Example:
print("Hello, World!")
Output:
Hello, World!
2
BT1IT Python Ahmad Serhan
Try it yourself:
1. Open any text editor.
2. Type the code above.
3. Save it as [Link].
4. Run it with:
5. python [Link]
1.5 Introduc�on to IDEs and Text Editors
IDEs (Integrated Development Environments) make coding easier with features like highligh�ng, auto-
comple�on, and debugging.
Popular Python IDEs:
IDE Descrip�on
Thonny Great for beginners, simple interface
IDLE Comes with Python installa�on
VS Code Advanced, supports mul�ple languages
PyCharm Professional IDE with many features
1.6 Wri�ng and Running Python Scripts
Two main ways to run Python:
1. Interac�ve Mode
o Open Python shell and type commands directly.
2. >>> print("Python is fun!")
o Good for quick tes�ng.
3. Script Mode
o Write code in a .py file and run it.
4. # [Link]
5. print("Welcome to Python Programming")
3
BT1IT Python Ahmad Serhan
o Run it from terminal:
o python [Link]
Exercise:
Create a Python script that prints:
My name is <your name>
I am learning Python programming.
� Mini Quiz
1. What is programming?
2. List two advantages of Python.
3. What is the file extension for Python programs?
4. What does this line of code do?
5. print("Learning is fun!")
6. Name one Python IDE.