Skip to content

Latest commit

 

History

History
109 lines (69 loc) · 1.68 KB

File metadata and controls

109 lines (69 loc) · 1.68 KB

Introduction to Python

1. What is Python?

Python is a high-level, interpreted programming language used in:

  • Web development
  • Automation
  • Data analysis
  • Machine learning
  • Game development

Python is known for its simplicity and readability, making it ideal for beginners.

Example:

print("Hello World")

2. Why Python is Good for Beginners

Python does not require complex setup, curly braces, or semicolons. It emphasizes English-like syntax, so it’s easier to read and write.


3. How Python Works

Python code is interpreted, meaning it runs line by line. This helps beginners quickly see errors and results.


4. Installing Python

  1. Visit https://www.python.org
  2. Download the latest stable version
  3. Run the installer
  4. Check installation:
python --version

5. Running a Python Program

You can run Python in:

  • Python IDLE
  • Terminal / Command Prompt
  • Code editors like VS Code
  • Mobile apps (Pydroid / QPython)

Example file: hello.py

print("Welcome to Python")

Run it:

python hello.py

6. Understanding the First Program

print("Hello World")
  • print() is a built-in function
  • "Hello World" is a string literal
  • Output shows text on screen

7. Common Beginner Mistakes

  • Using capital Print() instead of print()
  • Missing quotes
  • Incorrect installation

8. Practice Exercises

Try these:

  1. Print your name
  2. Print two different messages
  3. Print a number

Example:

print("Name")
print("CodingGita Rocks!")
print(100)