Professional Documents
Culture Documents
Lesson 9 Modules - LP
Lesson 9 Modules - LP
LearnIT
Python Coding
LESSON PLAN
School Grade Level
Teacher Learning Area Python Coding
Teaching Date and
Quarter
Time
I. OBJECTIVES
In this lesson, students will explore Python's extensibility using modules. We'll learn how to download them, import
them into our programs, and use their functionalities.
Specific Objectives:
After studying this lesson, the students should be able to:
1. explore built-in modules available in Python;
2. download and import modules; and
3. use modules to build programs.
ISTE Empowered Learner 1A-1B, Digital Citizen 2A-2D , Knowledge Constructor 3A-3D, Innovative
Standards: Designer 4A-4D, Computational Thinker 5A-5D,
CSTA 3A-CS-01, 3A-CS-02, 3A-1C-24, 3A-1C, Algorithms and Programming 3A-AP-13 – 3A-AP-23
Standards:
Values Integration:
1. Ability to think clearly and logically.
2. Longing to know and understand.
3. Independence of thought and flexibility of mind.
4. Awareness of the use of information technology skills in the world beyond the classroom.
References:
i. LearnIT – Python Coding Pages
Websites:
i.
IV. PROCEDURES
● for modules
C. Presenting
examples/instances of the ● for files
new lesson
● for directory
After the game, the teacher will ask the students to give meaning to the words used in the
game.
Practice Activity:
The Teacher will ask the students to try the following:
a. import math
dir(math)
*Explain that With the built-in function dir() and the name of the module as an
argument, you can list all valid attributes and methods for that module.
b. import math
cities = ["New York", "Toronto", "Berlin", "Washington", "Amsterdam",
"Hamburg"]
dir()
E. Discussing new concepts *Ask the students, what happen? Then explain the reason why the output is like
and practicing new skills #2 that, that’s because calling dir() without an argument, a list with the names in the
current local scope is returned:
c. import builtins
dir(builtins)
*displays all list of the Built-in functions, exceptions, and other objects by
importing the builtins module
Teachers Discussion Part 2
2. The Teacher will demonstrate how to work with Modules and PackagesDefining
Classes
a. Random
b. Turtle
c. Tkinter
Note: Make sure that the students will do also all the examples that you’ve shown to them.
EXPLAIN
F. Developing mastery (leads Hands-On
to Formative Assessment 3) 1. The teacher will ask the students to create their own Turtle.
G. Finding practical
applications of concepts
and skills in daily living
ELABORATE
1. The teacher will ask the students to tell something about the topic.
H. Making generalizations and 2. The Teacher will ask the students the student’s what kind of program they want to
abstractions about the create.
lesson
EVALUATE
STUDENT ACTIVITY 1:
The teacher will ask the students to Write code
1. Write code that will print random whole numbers from 2000 to 3000 that are divisible by
10.
I. Evaluating learning 2. Using the Turtle module, draw a right triangle with a base length of 20 pixels and a height
of 80 pixels.
3. Create an app that features a button that will change a text label's color every time it is
clicked. The colors can be: red, blue, black, yellow, orange, and green. Hint: The configure
method takes on foreground values e.g. "foreground='blue'". You can simply modify the
coin flipper app's code.
V. REMARKS
Answer Keys
EVALUATE
Student Activity No. 1
1.
The code:
import random
2. The code:
import turtle
ttl = turtle.Turtle()
ttl.forward(20)
ttl.left(104) # can be a close or an approximate value
ttl.forward(80)
ttl.left(166) # can be a close or an approximate value
ttl.forward(82.46) # can be a close or an approximate value
turtle.done()
3. The code:
window = Tk()
window.geometry('200x80')
window.title('Change Colors')
def change():
color = random.choice(['red', 'blue', 'black', 'yellow', 'orange', 'green'])
title.configure(foreground=color)
window.mainloop()