Introduction to Python: Meaning and Uses of Python Syntax and Simple Python Commands | Primary 5 (Basic 5) Information Technology (Computer Studies) | Third Term Week 9
INTRODUCTION TO PYTHON SYNTAX: MEANING AND USES OF PYTHON SYNTAX, SIMPLE PYTHON SYNTAX COMMANDS
INFORMATION TECHNOLOGY (COMPUTER STUDIES)
PRIMARY 5 – THIRD TERM – WEEK 9
THEME – BASIC COMPUTER OPERATIONS
PREVIOUS LESSON – Setting Up HTML and How Html Works | Primary 5 (Basic 5) Information Technology (Computer Studies) | Third Term Week 8
TOPIC – INTRODUCTION TO PYTHON AND SYNTAX
LEARNING AREA
1. Introduction
2. Meaning and Uses of Syntax
3. Meaning and Basic Rules of Python Syntax
4. Simple Commands and Practical Activities
5. Weekly Assessment: Test Questions and Answers/Assignment
6. Summary
LEARNING OBJECTIVES
By the end of the lesson, pupils should be able to:
1. Define Python.
2. State the uses of Python.
3. Explain Python syntax.
4. Write simple Python commands.
5. Run a simple Python program.
ENTRY BEHAVIOUR
Pupils have previously learned the meaning of coding, computer code, and the importance of programming. They have also been introduced to beginner-friendly programming tools such as Scratch and learned how to create simple programs using drag-and-drop programming blocks.
This lesson builds on that knowledge by introducing Python, a text-based programming language. Pupils will learn the meaning of Python, its uses, basic Python syntax, and simple Python commands used to write and run computer programs.
INSTRUCTIONAL MATERIALS
The teacher will teach the lesson with the aid of:
1. Computer or laptop
2. Multimedia projector (optional)
3. Python software (e.g., Python IDLE or Thonny IDE) or an online Python editor
4. Whiteboard and marker
5. Sample Python programs
6. Charts showing simple Python commands and syntax
7. PowerPoint presentation (optional)
8. Internet connection (if using an online Python editor)
9. Pupils’ notebooks and writing materials
METHOD OF TEACHING
Choose a suitable and appropriate methods for the lessons.
Note – Irrespective of choosing methods of teaching, always introduce an activities that will arouse pupil’s interest or lead them to the lessons.
REFERENCE MATERIALS
1. Scheme of Work
2. 9 – Years Basic Education Curriculum
3. Course Book
4. All Relevant Material
5. Online Information
CONTENT OF THE LESSON
INTRODUCTION
After learning how to create programs using Scratch, pupils are introduced to Python, one of the most popular programming languages in the world. Unlike Scratch, which uses colourful blocks, Python uses typed commands to give instructions to a computer.
In this lesson, pupils will learn the meaning of Python, its uses, the basic rules for writing Python programs (Python syntax), and simple Python commands for displaying messages and performing simple tasks.
LESSON 1 – MEANING OF PYTHON
Python is a high-level, text-based programming language that is easy to read, write, and learn. It is used to create computer programs, websites, mobile applications, games, and many other digital solutions.
USES OF PYTHON
Python is used for:
1. Developing computer software.
2. Creating websites.
3. Developing mobile applications.
4. Making computer games.
5. Data analysis.
6. Artificial Intelligence (AI).
7. Robotics.
8. Automation of tasks.
LESSON 2 – PYTHON SYNTAX
Python syntax refers to the rules that must be followed when writing Python programs.
BASIC RULES OF PYTHON SYNTAX
1. Use the correct spelling of commands.
2. Python is case-sensitive (Print and print are different).
3. Use quotation marks (” ” or ‘ ‘) for text.
4. Use proper indentation where required.
5. Write one instruction per line whenever possible.
SIMPLE PYTHON COMMANDS
1. Displaying a Message – print(“Hello, World!”)
Output: Hello, World!
2. Displaying Your Name – print(“My name is David.”)
3. Performing Addition – print(5 + 3)
Output: 8
4. Displaying a Welcome Message – print(“Welcome to Python Programming”)
LESSON 3 – PYTHON PRACTICAL DEMONSTRATION
The teacher demonstrates how to write and run simple Python programs using a computer with Python IDLE, Thonny, or an online Python editor.
Activity 1: Opening Python
1. Switch on the computer.
2. Open Python IDLE or Thonny.
3. Show pupils the Python window where commands are typed.
Activity 2: Writing the First Python Program
- The teacher types: print(“Hello, World!”)
- Then clicks Run to display the output.
- Output: Hello, World!
Activity 3: Printing Your Name
- The teacher types: print(“My name is John.”)
- Pupils replace John with their own names.
Activity 4: Simple Arithmetic
The teacher types:
- print(5 + 3)
- print(10 – 4)
- print(6 * 2)
Pupils observe the answers displayed on the screen.
Activity 5: Using Variables
The teacher demonstrates:
name = “Mary”
age = 10
print(name)
print(age)
The teacher explains that a variable stores information.
PUPIL’S PRACTICAL ACTIVITIES
Each pupil should:
1. Open Python IDLE or Thonny.
2. Type and run: print(“Welcome to Python”)
3. Type and run: print(“My name is _____”)
(Replace the blank with your name.)
4. Type and run: print(7 + 5)
5. Save the p rogram with the filename MyFirstPython.py.
WEEKLY ASSESSMENT: TEST QUESTIONS AND ANSWERS/ASSIGNMENT
A. Multiple Choice Questions
1. Python is a ________ programming language.
a. Machine
b. Text-based
c. Binary
d. Visual
2. Which Python command is used to display a message on the screen?
a. show()
b. display()
c. print()
d. output()
3. Python can be used to create ________.
a. Websites
b. Computer games
c. Mobile applications
d. All of the above
4. Which of the following is a Python editor?
a. Microsoft Word
b. Paint
c. IDLE
d. Calculator
5. Python syntax refers to the ________.
a. Colour of Python
b. Keyboard layout
c. Speed of a computer
d. Rules for writing Python programs
B. Fill in the Gaps
Complete the sentences using the words in the box: Python, print(), syntax, IDLE, quotation marks
6. _______ is a programming language.
7. The _______ function displays output on the screen.
8. Python _______ refers to the rules for writing Python programs.
9. _______ is one application used to write and run Python programs.
10. Text in Python is enclosed in _______.
C. True or False
11. Python is a text-based programming language. _______
12. The print() command displays output on the screen. _______
13. Python cannot be used to create websites. _______
14. Python syntax provides rules for writing Python programs correctly. _______
15. Python is only used for making games. _______
D. Match Column A with Column B.
Column A – Column B
16. Python – A. Displays output
17. print() – B. Rules for writing Python code
18. Syntax – C. Programming language
19. IDLE – D. Python editor
20. Quotation marks – E. Used to enclose text
ANSWER KEYS
1. B – Text-based
2. C – print()
3. D – All of the above
4. C – IDLE
5. A – Rules for writing Python programs
6. Python
7. print()
8. syntax
9. IDLE
10. quotation marks
11. True
12. True
12. False
13. True
14. False
16. C – Programming language
17. A – Displays output
18. B – Rules for writing Python code
19. D – Python editor
20. E – Used to enclose text
SUMMARY
In this lesson, pupils learned that Python is a text-based programming language used to create computer programs, websites, mobile applications, games, and many other digital solutions.
Pupils learned the uses of Python and discovered that it is widely used in software development, web development, game development, robotics, artificial intelligence (AI), automation, and data analysis.
Furthermore, pupils learned that Python syntax refers to the rules for writing Python programs correctly. They were introduced to basic syntax rules, such as using the correct spelling of commands, writing text inside quotation marks, understanding that Python is case-sensitive, and writing clear, well-structured code.
Finally, pupils practised writing and running simple Python commands, including using the print() function to display text and numbers on the screen. These activities helped them understand the basics of text-based programming and prepared them for more advanced Python programming concepts.
PRESENTATION
To deliver the lesson, the teacher adopts the following steps:
To deliver the lesson, the teacher adopts the following steps:
Step 1: Introduction – The teacher asks pupils if they have ever used a computer program, played a computer game, or wondered how computers understand instructions. The teacher explains that computers follow instructions written in programming languages and introduces Python as one of the most popular programming languages used today.
Pupils’ Activities: Pupils mention computer programs or games they know and listen attentively to the teacher’s explanation.
Step 2: Meaning of Python – The teacher explains that Python is a text-based programming language used to write instructions that tell a computer what to do. The teacher further explains that Python is easy to read, write, and learn, making it suitable for beginners.
Pupils’ Activities: Pupils explain the meaning of Python in their own words.
Step 3: Uses of Python – The teacher discusses the various uses of Python, explaining that it is used to:
- Develop computer software.
- Create websites.
- Develop mobile applications.
- Create computer games.
- Build robots.
- Develop Artificial Intelligence (AI) systems
- Analyse data.
- Automate tasks.
Pupils’ Activities: Pupils state the uses of Python and give examples where applicable.
Step 4: Python Syntax – The teacher explains that Python syntax refers to the rules for writing Python programs correctly. The teacher highlights some basic syntax rules:
- Use the correct spelling of commands.
- Python is case-sensitive.
- Use quotation marks for text.
- Write one instruction per line.
- Use proper indentation where required.
The teacher demonstrates correct and incorrect examples of Python syntax.
Pupils’ Activities: Pupils identify the basic syntax rules and distinguish between correct and incorrect Python commands.
Step 5: Practical Demonstration – The teacher opens Python IDLE, Thonny, or another Python editor and demonstrates how to:
- Open the Python editor.
- Type a simple print() command.
- Run the program.
- Display text on the screen.
- Perform simple arithmetic using the print() function.
Pupils’ Activities: Pupils follow the demonstration by typing and running simple Python commands and observing the output.
Step 6: Group Activity – The teacher divides the class into four groups and assigns the following activities:
- Group 1: Define Python.
- Group 2: State five uses of Python.
- Group 3: Explain Python syntax and state four basic syntax rules.
- Group 4: Write and run three simple Python commands using the print() function.
Each group presents its work before the class.
Pupils’ Activities: Pupils discuss the assigned tasks, complete the activity, and present their findings.
Step 7: Lesson Summary – The teacher reviews the meaning of Python, its uses, Python syntax, and simple Python commands. The teacher reinforces how the print() function is used to display output and explains the importance of following Python syntax rules when writing programs.
Pupils’ Activities: Pupils answer oral questions and summarise the lesson.
Step 8: Evaluation – The teacher asks oral and written questions to assess pupils’ understanding of the meaning of Python, its uses, Python syntax, and simple Python commands.
Pupils’ Activities: Pupils answer the evaluation questions and participate actively in the lesson.
CONCLUSION
To conclude the lesson for the week, the teacher revises the entire lesson and links it to the following week’s lesson.
NEXT LESSON
LESSON EVALUATION
Teacher asks pupils,
1. Define Python.
2. Explain the meaning of a text-based programming language.
3. State five uses of Python.
4. Explain the meaning of Python syntax.
5. Mention five basic rules of Python syntax.
6. Write and run simple Python commands using the print() function.
7. Demonstrate how to:
- Open a Python editor (e.g., Python IDLE or Thonny).
- Type a simple Python command.
- Run the program.
- Interpret the output displayed on the screen.