10 min read
Introduction
Why Python, how the in-browser Run button works, and the shop programs you will build in this course.
Why Python?
Python is one of the most popular programming languages in the world. It is used for websites, data analysis, automation, science and artificial intelligence — and it is a favourite first language because its code reads almost like English.
The same task in two languages
| Java | Python |
|---|---|
System.out.println("Hello"); | print("Hello") |
| Declare a type for every variable | Just write total = 0 |
| Curly brackets group code | Indentation (spaces) groups code |
What You Will Build
Perera Corner Mart, Starlight Cinema and their prices are made up for this unit. Any resemblance to real businesses is a coincidence.
Running Code in This Course
Every Python example has a Run button. The first time you press it, your browser downloads Python (about 10 MB) — after that, runs are instant. Your code runs on your own device; nothing is sent to a server.
- Edit code lets you change the example and run your version.
- If a program asks for input, type the values in the Inputs box, one per line.
- Reset puts the original example back.
Press RunPython
print("Welcome to Perera Corner Mart")print("Open 7 am to 10 pm")Expected output
Welcome to Perera Corner Mart Open 7 am to 10 pm
Practice
More lessons in Python Programming · Next: Setting Up Python
