Hello World in Python

Your First Python Program: Saying “Hello World” 🌎

Ready to dive into the world of Python programming? Let’s start with the most iconic introductory program – printing “Hello World” to the console. It’s a simple yet satisfying way to begin your coding journey.

Here’s the code:

print("Hello World")

Let’s break it down:

  • print(): This is a built-in Python function. Its job is to display whatever is inside the parentheses on your screen.
  • “Hello World”: This is the text you want to display. The text needs to be enclosed in quotation marks (single or double) to tell Python it’s a string literal (a piece of text).

How to Run the Code:

  1. Save your code: Open a text editor (like Notepad, Sublime Text, or VS Code) and paste the code. Save the file with a .py extension (e.g., hello.py).
  2. Open your terminal/command prompt: Navigate to the directory where you saved your file.
  3. Run the code: Type python hello.py (replace hello.py with your file name) and press Enter.

You did it! You should now see “Hello World” displayed in your terminal. 🎉

This might seem basic, but it introduces fundamental programming concepts like:

  • Syntax: Python’s specific rules for writing code.
  • Functions: Blocks of reusable code that perform tasks.
  • Data Types: “Hello World” is a string of characters.

This is just the beginning. Stay tuned for more Python adventures! 🚀




    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
  • Displaying External Posts on Your al-folio Blog
  • Boost Your Online Skills
  • Directory Tree Printer
  • GitHub Setup and Encryption Guide