Python Programming - Beginner Notes
Chapter 1: Introduction to Python
What is Python?
- Python is a high-level, interpreted programming language.
- It is known for its simple and readable syntax.
- It supports multiple programming paradigms: procedural, object-oriented, and functional.
Why Learn Python?
- Easy to read and write.
- Used in web development, data science, automation, and more.
- Large community and library support.
Installing Python:
- Visit https://www.python.org/
- Download and install the latest version for your OS.
- Verify installation using the command: python --version
Writing Your First Python Program:
1. Open any text editor (like Notepad) or IDE (like VS Code or PyCharm).
2. Write the following code:
print("Hello, World!")
3. Save the file as first_program.py
4. Run it using the terminal/command prompt:
python first_program.py
Basic Python Syntax:
- Python uses indentation (spaces) to define blocks of code.
- Statements end by a newline (no need for semicolons).
- Comments start with the # symbol.
Example:
# This is a comment
print("Welcome to Python!")
Conclusion:
- Python is simple and powerful.
- You just wrote your first Python program!
- Next, we will explore variables and data types.