Skip to content

Assignment: Write Hello World

Programming for Everybody (Getting Started with Python) Module 3 Assignment: Write Hello World


Question: Print “hello world”

Instructions

Write a Python program that:

  • Uses the print() function to display "hello world".
  • Matches the exact output as shown below:
    hello world
    

Correct Python Code

# Corrected print statement
print("hello world")

Expected Output

hello world

Explanation

  1. The original code had a typo:
    prinq("hello world") (Incorrect function name)
  2. The correct function is print(), which outputs text to the console.
  3. The quotation marks around "hello world" ensure it is treated as a string.
  4. When executed, Python prints the message exactly as required.

Why This Code is Correct

✅ Fixes the syntax error (prinqprint).
✅ Matches the exact required output.
✅ Uses Python’s built-in print() function properly.