Getting Started with Python
Welcome to Python
Python is a high-level programming language known for being clean and readable. It is used for websites, data analysis, automation, artificial intelligence, and much more. The best part for a beginner is that Python code often reads almost like plain English.
Your First Program
Every programmer starts here. The print() function displays text on the screen. Type the line below into a file called hello.py and run it.
print("Hello, DCCPS!")When you run this file, Python reads it from top to bottom and shows the message. The text inside the quotation marks is called a string — a piece of text data.
Comments
A comment is a note for humans that Python ignores. Comments start with the # symbol. Use them to explain why your code does something.
# This line greets the user
print("Welcome to programming") # this part is also a commentHow Python Runs Your Code
Python is an interpreted language. That means an interpreter reads your instructions one line at a time and carries them out immediately. You do not need a separate compile step, which makes experimenting fast and friendly.
- Write your code in a
.pyfile. - Run it with the command
python hello.pyin a terminal. - Read the output and fix any mistakes.
Tip: Programming is learned by doing. Type every example yourself instead of copying — your fingers will remember what your eyes forget.
If Python reports an error, do not panic. Errors are normal. The message usually tells you the line number and the kind of problem, which is your clue for the fix.
Discussion
1