Lesson 1 – What is Python?

Python is a well-known programming language used by students, developers and many of the world’s largest organisations. It is popular because it is simple to write, easy to understand and extremely powerful. You will find Python being used in artificial intelligence, automation, robotics, website development, scientific research, game development and many other areas.

When you create a Python program, you are giving clear step-by-step instructions to the computer. The computer follows these instructions in order, from top to bottom. By learning even the basics of Python, you can build programs that display information, solve problems, process data and perform useful tasks automatically.

Why Learn Python?

Your First Python Program

A programmer’s journey usually begins with a simple instruction that displays a message. This helps you see how Python reads your code and produces an output.

print("Hello, World!")
            

When Python runs this instruction, it shows the message inside the quotation marks exactly as it is written.

Examples for Beginners

Example One: How can I show a welcome message?

print("Welcome to your first Python lesson")
            

Explanation: The print instruction makes Python display whatever is inside the quotation marks.

Output:

Welcome to your first Python lesson
            

Example Two: How can I show two lines of text?

print("Learning Python is fun")
print("You are doing great")
            

Python reads each instruction from top to bottom. Because there are two print instructions, the messages appear on separate lines.

Learning Python is fun
You are doing great
            

Example Three: Can Python perform a calculation?

print(12 + 8)
            

Explanation: Python adds the numbers and shows the result.

Output:

20
            

Example Four: What happens when I mix text and numbers?

print("The total is", 5 + 3)
            

Python displays the sentence first and then calculates the number eight.

The total is 8
            

Check Your Understanding

Select an answer and reveal the correct one afterwards.

1. What is Python mainly used for?





Correct answer: Writing computer programs.

2. Which instruction displays text on the screen?





Correct answer: print().

3. What does Python display for print(7 + 3)?





Correct answer: 10.

4. Which companies use Python?





Correct answer: All of them.

5. What does print("Hello") do?





Correct answer: Shows the word Hello.

6. How does Python read instructions?





Correct answer: From top to bottom.

7. What is the output of print("The sum is", 4 + 6)?





Correct answer: The sum is 10.

8. Which area uses Python?





Correct answer: Artificial intelligence.

9. Who can learn Python?





Correct answer: Anyone interested in programming.

10. What does Python display for print("Good job")?





Correct answer: Good job
Back to Top