Your First Python Program

Writing and running your first Python script

Interview Relevant: Foundation for all Python development

Your First Program

Python scripts are plain text files with the .py extension.

Code Examples

A simple script using print to output text.

python
1# hello.py
2print("Hello, Python!")
3
4# Variables
5name = "World"
6print(f"Hello, {name}!")

Executing the script from the terminal.

bash
1# Run the script
2python hello.py

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In