Learn with Yasir

Share Your Feedback

Python Basics: Python Introduction, Setup, Hello World


Learn Python basics with beginner-friendly tutorials, examples, and exercises. Master Python programming concepts like print function, variables, comments, indentation and more. Perfect for students and professionals starting their Python journey.

Table of Contents

  1. What is Python?
  2. Setting Up Python
  3. Your First Python Program: “Hello, World!”
  4. Comments
  5. Indentation

🔰 1. What is Python?

  • Python is a high-level, interpreted general-purpose programming language.
  • Known for its simple syntax and readability.
  • Used in web development, data analysis, AI/ML, automation, scripting, and more.

Key Features:

  • Easy to learn
  • Huge standard library
  • Cross-platform
  • Strong community support

💻 2. Setting Up Python

  1. Visit https://www.python.org/downloads/
  2. Download the latest version for your OS (Windows/macOS/Linux).
  3. During installation, check the box that says “Add Python to PATH”.
  4. To check installation, open your terminal or command prompt and type:

    python --version
    

    Or, if that doesn’t work:

    python3 --version
    

Option B: Use Online Python Editors

📚 Learn more… 🔗 Python Tools/IDE’s or Editors 🛠️


🧪 3. Your First Python Program: “Hello, World!”

Step 1: Open a code editor or terminal.

You can use:

  • IDLE (Python’s built-in editor)
  • VS Code
  • PyCharm
  • A simple text editor like Notepad

Step 2: Type the following code:

print("Hello, World!")

Step 3: Save the file as hello.py

Step 4: Run the program

In terminal/command prompt:

python hello.py

If successful, you’ll see:

Hello, World!

📘 Explanation

  • print() is a built-in Python function that outputs text to the screen.
  • "Hello, World!" is a string (text inside double or single quotes).

4. Comments

5. Indentation


Task : Code Together, Lead Together

Title: “Teach Your Team”
Instructions:

  1. Each student picks one basic Python topic (e.g., print function,Basic Printing, Printing Different Data Types, Using sep and end Parameters, Print Variables, String Formatting with f-Strings, Printing Special Characters, Syntax Error, Comments, Indentation).
  2. Prepare a 2-minute explanation for the group (using examples).
  3. Deliver their explanation to the team.
  4. Peers ask questions and give feedback.

💡 Key Learning Points:
✔ Leadership through teaching.
✔ Confidence in public speaking.
✔ Understanding Python better by explaining it.

References and Bibliography


🧠 Practice & Progress

Explore More Topics

📘 Learn Python

Tutorials, Roadmaps, Bootcamps & Visualization Projects

Python Fundamentals

Flow Control Statements


Python Functions


Fundamentals more ...




🧠 Python Advanced

Object-Oriented Programming in Python (OOP)

More...

🧠 Modules