Computer Science Researcher • Educator • Programming Instructor
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.
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.
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
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
print(12 + 8)
Explanation: Python adds the numbers and shows the result.
Output:
20
print("The total is", 5 + 3)
Python displays the sentence first and then calculates the number eight.
The total is 8
Select an answer and reveal the correct one afterwards.
1. What is Python mainly used for?
2. Which instruction displays text on the screen?
3. What does Python display for print(7 + 3)?
4. Which companies use Python?
5. What does print("Hello") do?
6. How does Python read instructions?
7. What is the output of print("The sum is", 4 + 6)?
8. Which area uses Python?
9. Who can learn Python?
10. What does Python display for print("Good job")?