Getting Started with Python
Install Python, run code in the interactive shell or as a script, and learn why indentation matters.
Beginner
- Install Python 3 from python.org (tick "Add to PATH" on Windows).
- Run
python(orpython3) for the interactive REPL, great for quick experiments. - Save code in
hello.pyand runpython hello.py.
name = input("Your name: ")
print(f"Hello, {name}!")
Python uses indentation (4 spaces by convention) instead of braces to group statements — inconsistent indentation is a syntax error. Comments start with #.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.