Chap 2 Notes
Chap 2 Notes
Introduction to Python
• Python is a high-level, interpreted, and general-purpose programming language.
• It was created by Guido van Rossum and released in 1991.
• Python emphasizes code readability with its clean and easy syntax.
Features of Python
1. Easy to Learn and Use – Syntax is simple and close to English.
2. Interpreted Language – No need for compilation, executed line by line.
3. Dynamically Typed – No need to declare data types.
4. Free and Open Source – Available freely.
5. Portable – Can run on different platforms (Windows, Mac, Linux).
6. Extensive Libraries – Rich set of built-in modules and functions.
⸻
Python vs. Other Languages
• Comparison based on syntax, execution, type system, etc.
• Unlike C or Java, Python:
• Does not need explicit data type declaration.
• Has shorter and cleaner syntax.
• Is interpreted (no compiling needed).
• Easier to debug and develop.
Definition
• Computer programming is the process of writing a set of instructions for a computer to
perform a task.
• These instructions are written in a programming language that the computer can
understand and execute.
Example Analogy
• Think of it like giving directions to a friend to reach your house.
• Directions must be clear and precise—just like programming instructions must be for a
computer.
Purpose
• To instruct computers in solving problems, automating tasks, and performing logical
operations.
• Helps in achieving specific goals through efficient, understandable code.
⸻
Definition
• The development environment is the setup needed to write, run, and debug Python
programs.
Includes
• Installing Python from the official website:
https://www.python.org/
• Configuring necessary:
• Software
• Tools
• Libraries
Tidbit
When installing Python, check the box that says “Add Python to PATH”.
This allows Python to run from the command line, making it easier to execute Python files.