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
- The original code had a typo:
❌prinq("hello world")
(Incorrect function name) - The correct function is
print()
, which outputs text to the console. - The quotation marks around
"hello world"
ensure it is treated as a string. - When executed, Python prints the message exactly as required.
Why This Code is Correct
✅ Fixes the syntax error (prinq
→ print
).
✅ Matches the exact required output.
✅ Uses Python’s built-in print()
function properly.