
LESSON 3: PREDEFINED FUNCTIONS, BOOLEAN & SELECTION STATEMENTS
Presentation
•
Computers
•
7th Grade
•
Hard
Esperanza Sabangan
Used 12+ times
FREE Resource
29 Slides • 21 Questions
1
LESSON 3: Predefined Functions, Boolean Expressions and Selection Statements
2
3
4
Poll
Which among these things you did do after you get vaccinated?
5
6
“What’s the logic behind?” is a VISUAL BRAIN TEASER LOGICAL PUZZLE GAME. The game will enhance your critical thinking ability.
ALL OF YOU will be the participants and must answer by analyzing the pictures or illustrations to be shown.
You will be given a duration of 45 seconds to answer.
Let's Get it on Pythons!
7
Open Ended
What’s the logic behind?
Your task is to move just one matchstick to fix the equation. This math question seems simple, however, how quickly can you find all 3 solutions?
8
1. 5 + 4 = 9
2. 8 - 4 = 4
3. 0 + 4 = 4
9
Open Ended
What’s the logic behind?
Mike, Andrew, Kevin and Rory are playing tug of war. Mike and Andrew pulled Kevin and Rory easily. After that, both Mike and Kevin together managed to pull Rory and Andrew hardly. Then, both Mike and Rory played against Andrew and Kevin but neither of them won the game.
Thus, can you compare them according to their strength?
10
11
Open Ended
What’s the logic behind?
Replace the question mark with a number respecting the equations below. Find the pattern.
12
If we think that each number on the left is the power of 4.
41=4
42=16
43=64
44= 256
13
Open Ended
What’s the logic behind?
Two people played chess 5 times.
Both of them won the same number of games and there was not a single draw. How could this happen?
14
It is only possible if they play with other people.
15
Open Ended
What’s the logic behind?
Please use all the numbers and equation marks only once and do the correct equation.
16
4+5=32
17
Open Ended
What’s the logic behind?
In order to transfer all the balls from the 1st tube to the 3rd tube by keeping them in their original order, how many moves should be done and what are those movements?
(P.S: Name the balls like 1-2-3, and name the tubes I-II-III)
18
OPTION 1:
Do these moves in these orders:
Transfer the 3rd ball from 1st tube to 2nd tube
Transfer the 2nd ball from 1st tube to to 2nd tube
Transfer the 1st ball from 1st tube to 3rd tube
OPTION 2:
Transfer the 2nd ball from 2nd tube to to 3rd tube
Transfer the 3rd ball from 2nd tube to to 3rd tube
19
Open Ended
What’s the logic behind?
If the dice will be moved until the pointed arrow's end, which number will be on the top?
20
As a tip, The sum up of the numbers of two reciprocal squares on dice is always 7.
So, the answer is 3.
21
Open Ended
What’s the logic behind?
When you fold this figure and get a cube, what will be the colors of reciprocal squares?
22
Reciprocal squares will be: Yellow-Red / Blue-Purple / Green-Pink
23
24
Open Ended
How will apply your programming skills in Python's arithmetic operations in daily real life situations?
25
Open Ended
How do you create and assign values to variables?
26
Let's go deeper Pythons! LESSON 4: PREDEFINED FUNCTIONS
27
Content:
✓ Explain the purpose of a predefined function
✓ Explain the functions: abs(), pow(), int() round(), random
✓ Explain the math library functions: floor() and ceil()
✓ Explain the use of the import statement
✓ Explain the purpose of a function argument
Process:
✓ Write code that uses predefined functions
28
Python Activity 5: Predefined Functions Learning Objectives Contents
29
Open Ended
Easy Level Based on your hands-on 3.3 experience and in your own words, how will you define predefined functions in python?
30
Reducing duplication of code
Decomposing complex problems into simpler pieces
Improving clarity of the code
Reuse of code
Information hiding
Functions in Python are first-class citizens. It means that functions have equal status with other objects in Python. Functions can be assigned to variables, stored in collections or passed as arguments. This brings additional flexibility to the language.
31
“Modularizing your Code”
32
33
Open Ended
Average Level Enter and execute the Python program.
print(abs(-4.67))
print(pow(5,3))
print(pow(49,.5))
print(int(34.8))
print(round(6.9))
import random
print(random.randint(1,100))
a. What is the output for each statement?
b. What is the difference between the round() function and the int() function?
34
35
Open Ended
Difficult Level Enter and execute the Python program.
import math
x = 4.7
y = 5.3
z = -4.8
a = -3.2
print(math.ceil(x)) print(math.ceil(y)) print(math.ceil(z)) print(math.ceil(a)) print(math.floor(x)) print(math.floor(y)) print(math.floor(z)) print(math.floor(a))
a. What is the output for each statement?
b. What is the difference between the ceil() function and the floor() function?
36
37
Open Ended
Easy Level Why and how do we use import statement in python?
38
Identify the function definition, function header and the function call in given program.
39
SAMPLE FUNCTIONS IN MATH MODULE
40
Open Ended
Easy Level What is an argument?
If a function contains more than one argument, do you think the order of the arguments makes a difference? Explain your answer.
41
Python Activity 5: Predefined Functions Learning Objectives Process
42
Open Ended
Easy Level Write a line of code that prints the integer portion of the number 21.45.
43
Open Ended
Easy Level Write code that prompts the user for a floating-point number and prints the smallest integer that is larger than the number the user entered.
44
Open Ended
Easy Level Write a line of code that prints a random number between one and 6.
45
Open Ended
Difficult Level Assume that a user enters any number and that the number is stored in the variable userNumber. Write a line of code that converts the input to a float. Then write a line of code that prints the positive value of the user’s input.
46
Open Ended
Average Level Write a line of code that calculates the square root of 900 and stores the result in the variable answer.
47
48
49
50
Attendance Monitoring & Class Record Python Program
Attendance Monitoring, Class Record and Task Management Program
LESSON 3: Predefined Functions, Boolean Expressions and Selection Statements
Show answer
Auto Play
Slide 1 / 50
SLIDE
Similar Resources on Wayground
45 questions
08.26 | Plot Elements
Presentation
•
7th Grade
48 questions
Nervous System Notes
Presentation
•
7th Grade
46 questions
Force and Motion
Presentation
•
7th - 8th Grade
45 questions
SS7G6: Environmental issues SW Asia
Presentation
•
7th Grade
47 questions
Elkhorn History Images
Presentation
•
KG
43 questions
ICT 7 Q4L1 - The Internet and The World Wide Web
Presentation
•
7th Grade
45 questions
Latihan Soal
Presentation
•
7th Grade
46 questions
Linear Relationships Notes - 4/26
Presentation
•
7th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade