
LESSON 3: PREDEFINED FUNCTIONS, BOOLEAN & SELECTION STATEMENTS
Presentation
•
Computers
•
7th Grade
•
Hard
Esperanza Sabangan
Used 12+ times
FREE Resource
29 Slides • 21 Questions
1
PYTHON PROGRAMMING: HANDS-ON ACTIVITY 5 & 6
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
There are TWO rules that must hold in playing the game.
“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
POSSIBLE ANSWERS
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
ANSWER: Mike>Andrew>Kevin>Rory
11
Open Ended
What’s the logic behind?
Replace the question mark with a number respecting the equations below. Find the pattern.
12
ANSWER
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
ANSWER
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
ANSWER
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
ANSWERS
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
ANSWERS
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
ANSWERS
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
LEARNING OBJECTIVES
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
Let's go deeper Pythons!
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
A function is a piece of code in a program. The function performs a specific task. The advantages of using functions are:
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
Python Activity 7: Functions Program Structure
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
Let's get it on Pythons!
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
PYTHON PROGRAMMING: HANDS-ON ACTIVITY 5 & 6
LESSON 3: Predefined Functions, Boolean Expressions and Selection Statements
Show answer
Auto Play
Slide 1 / 50
SLIDE
Similar Resources on Wayground
46 questions
GDPR en wetgeving
Presentation
•
KG
43 questions
Canadian Confederation
Presentation
•
7th Grade
42 questions
Tax, Tips, and Discounts!!!
Presentation
•
7th Grade
44 questions
Understanding The Constitution
Presentation
•
7th - 8th Grade
44 questions
7.05-7.06
Presentation
•
7th Grade
48 questions
Introduction to Poetry
Presentation
•
7th Grade
41 questions
Independent and Dependent Variables
Presentation
•
7th Grade
44 questions
Unit 4 Waves Test Review
Presentation
•
7th Grade
Popular Resources on Wayground
6 questions
Secondary Safety Quiz
Presentation
•
9th - 12th Grade
10 questions
Afterschool Activities & Sports
Quiz
•
6th - 8th Grade
19 questions
ROAR Week 2026
Quiz
•
9th - 12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
15 questions
Cool Tool:Chromebook
Quiz
•
6th - 8th Grade
22 questions
would you rather
Quiz
•
3rd - 11th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Early Computing
Quiz
•
7th - 12th Grade
10 questions
Exploring the Parts of a Computer
Interactive video
•
6th - 10th Grade
10 questions
Navigating Digital Citizenship and Online Safety
Interactive video
•
6th - 10th Grade
11 questions
Technology Acceptable Use
Quiz
•
6th - 8th Grade
9 questions
Discussion Boards
Quiz
•
6th - 8th Grade
10 questions
Mastering Proper Keyboarding Techniques
Interactive video
•
6th - 10th Grade