Skip to main content

๐Ÿ’š โ€” Print Something: Hello, World

Taskโ€‹

  • Create a new file named hello.py.
  • Write a program that prints: Hello, world! (exactly)
  • Run it from the terminal: python hello.py
  • (Optional) Print 3 different lines.
  • (Optional) Print a tiny 'spell' banner (ASCII art).

Example runโ€‹

$ python hello.py
Hello, world!

Solution (ATTEMPT FIRST)โ€‹

Show spoiler code (hello.py)

This is the 'first spell' of Python!

hello.py
"""hello.py

Your first Python spell ๐Ÿช„

Goal:
- Print EXACTLY: Hello, world!
- (Optional) Print a few extra lines.
"""

# The print(...) function writes text to the screen (stdout).
print("Hello, world!")

# Optional: extra lines (uncomment if you want).
# print("I have awakened.")
# print("Behold... my keyboard powers.")

# Optional alt approach: one print call can contain newlines using

# print("Line 1\nLine 2\nLine 3")

Docs / Tutorialsโ€‹