AI Hints
Home›Python Tutorial›Welcome to Python
Python · Lesson 1 of 49

Meet Ava, Meet Python

What Python is, and why it is everywhere.

⏱ 2 min read▶ Video at 0:00🎓 Free
Watch this lesson in the Python courseWatch on YouTube ↗Full Python course

Meet Ava. She used to be a librarian, and now she runs a small online plant shop called Leafy Corner. Every night, she copies orders from emails into a spreadsheet, adds up the totals by hand, and writes thank you notes one at a time. It takes hours. A friend says, why not teach the computer to do all of that? And the friend gives her one word. Python. Today, you and Ava begin this journey together, from absolute beginner, all the way to expert.

Meet Ava, Meet Python
From the video: Meet Ava, Meet Python
  • Ava: a former librarian, now a plant shop owner
  • The problem: hours of boring, repeated work
  • The plan: teach the computer to do it, with Python

What is Python?

Python is a programming language. That means it is a way to give clear instructions to a computer. Think of a recipe. You write the steps, in order, and the computer follows them exactly. Python was created by Guido van Rossum, and first released in nineteen ninety one. It was designed to be readable, almost like plain English. And it is free, and open source, for everyone.

A language for instructionsyou write the steps, the computer follows them
Readable by designclose to plain English
Created by Guido van Rossumfirst released in 1991
Free and open sourcefor everyone, forever

Where is Python used?

Python is everywhere. Websites and web apps. Data analysis and science. Artificial intelligence and machine learning. The automation of boring tasks, which is exactly what Ava needs. Games, robots, and research. Even cyber security. One language, and thousands of careers.

Websites and web appsthe servers behind many sites
Data and scienceanalyse numbers, draw charts
AI and machine learningteach computers to learn
Automationlet the computer do boring jobs
Games and robotsfrom small projects to big ones
Cyber securityfind and fix weak spots

How Python runs your code

How does a computer understand Python? You write a text file with your instructions, called a script. A program named the Python interpreter reads it, one line at a time, from top to bottom, and does what each line says. If something goes wrong, it stops, and tells you where. That makes Python fast to try, and friendly to learn.

  1. You writea script: a .py file
  2. Interpreter readsline by line, top to bottom
  3. Computer actsthe result appears
If something goes wrong, it tells you where
How Python runs your code
From the video: How Python runs your code

Your first program

Here is the smallest useful Python program. One line. The word print is a function, which shows something on the screen. Inside the brackets, between quotes, is the text we want to show. Run it, and the computer welcomes Ava's customers. Congratulations. You just wrote real Python.

welcome.pypython
print("Welcome to Leafy Corner!")
Output
Welcome to Leafy Corner!

Many instructions, in order

Programs usually have many lines. Python runs them in order, from top to bottom. Here, Ava prints a welcome, then today's special, then a thank you. Change the order of the lines, and the output changes too. In programming, order matters.

shop.pypython
print("Welcome to Leafy Corner!")
print("Today's special: monstera plants")
print("Thank you for shopping with us!")
Output
Welcome to Leafy Corner!
Today's special: monstera plants
Thank you for shopping with us!

Your turn. Pause the video, and write a program that prints two lines. Your name, and your favourite plant. Take your time, and run it. Ready? Here is one solution. Two print calls, one for each line. Yours can look different, as long as it prints two lines.

✍️ Exercise: Print two lines

Write a program that prints two lines: your name, and your favourite plant.

Show hint

Use print() twice, once per line.

Show solution
solution.pypython
print("My name is Ava")
print("My favourite plant is the fern")
Output
My name is Ava
My favourite plant is the fern

Summary

That was your first lesson. Python is a readable language for giving instructions. It is used for websites, data, artificial intelligence, automation, and much more. And you already wrote and ran your first programs. Next, Ava sets up Python on her own computer.

Key takeaways
  • Python is a readable language for instructions
  • The interpreter runs your script, top to bottom
  • print() shows text on the screen
Next up: Setting Up Python — install it, run it, and write code like a pro