Search Header Logo
LESSON 3: BOOLEAN EXPRESSIONS & SELECTION STATEMENTS

LESSON 3: BOOLEAN EXPRESSIONS & SELECTION STATEMENTS

Assessment

Presentation

Computers

7th Grade

Practice Problem

Easy

Created by

Esperanza Sabangan

Used 7+ times

FREE Resource

33 Slides • 32 Questions

1

PYTHON PROGRAMMING: HANDS-ON ACTIVITY 5 & 6

LESSON 3: Predefined Functions, Boolean Expressions and Selection Statements

media

2

media

3

media

4

Open Ended

Question image

What’s the funniest excuse you’ve ever used to get out of deadlines/for NOT complying with school requirements?

5

media

6

There are TWO rules that must hold in playing the game.

  • “What’s the condition behind the logic?” 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 60 seconds to answer.

  • Let's Get it on Pythons!

7

Open Ended

Question image

What’s the condition behind the logic?

Frank's father has 5 sons. If the names of his 4 sons are Fefe, Fifi, Fofo, Fufu, respectively, then what would be the name of his 5th son?

8

ANSWER


If, Frank's father has 5 sons and the names of 4 sons are like above.


Then, Frank is the 5th son already.

media

9

Open Ended

Question image

What’s the condition behind the logic?


Which one is the right view for the person who stays at the orange point and looks at the figure from the pointed direction?

10

ANSWER


If, there are obviously 4 blocks at the bottom. And the second layer above the bottom, there are 2 blocks on the right. So the answer is definitely not C.


Then, on the top layer, there is only one block that is seen.


So, the answer is D


media

11

Open Ended

Question image

What’s the condition behind the logic?


How many triangles are there in the image?

12

ANSWER

If,


The number of triangles forms of 1 unit: 16

The number of triangles forms of 4 units: 7

The number of triangles forms of 9 units: 3

The number of triangles forms of 19 units: 1


Then, the total number of triangles is 27.


media

13

Open Ended

Question image

What’s the condition behind the logic?


How can you get 30 by placing the balls into the boxes in the following equation?

14

ANSWER

This question cannot be solved mathematically. Because the sum of three odd numbers cannot be even. But here the important thing is your attention


If, you place the balls numbered with 11 and 13, you will get 24.


Then, if you place the ball numbered with 9 but inverted, you will get 24+6=30.


media

15

Open Ended

Question image

What’s the condition behind the logic?


How many squares are there on a chessboard?

16

ANSWER

If, we order them according to their sizes:

Then,

8x8 : 1

7x7 : 4

6x6 : 9

5x5 : 16

4x4 : 25

3x3 : 36

2x2 : 49

1x1 : 64

So on a chessboard, there are 204 square.

media

17

Open Ended

Question image

What’s the condition behind the logic?


Find the weights of animals below.

18

ANSWER


If, two bears weigh 120 kg, then one bear is 60 kg


Then, One bear and one rabbit weigh 70 kg and a bear is 60 kg, then a rabbit is 10 kg.


Else, One bear and one rabbit weigh 70 kg, and then a fox is 20 kg.

media

19

Open Ended

Question image

What’s the condition behind the logic?


How many squares are there in the image?

20

ANSWER

If,


The number of 1 unit squares: 6

The number of 2 units squares: 6

The number of 3 units squares: 3

The number of 4 units squares: 2


Then, the total number of squares is 17.


media

21

Open Ended

Question image

What’s the condition behind the logic?


What shape should be in the top brick?

22

ANSWER

An octagon. Each shape has the same number of sides as the sum of the sides of the two shapes below it.

 

If, the number is over 10, then the last digit is used instead. For example, 9 + 8 = 17 so the brick above is 7-sided.

 

Then, the top shape is an 8-sided octagon because there are two 4-sided shapes below it.

media

23

Open Ended

Question image

What’s the condition behind the logic?


Which of the four domino figures completes the set?

24

ANSWER


If, Each line contains two red dice and one blue die.


Each line contains a two, a three and a five.


Then, the missing image is of a red die, number three.

media

25

Open Ended

Question image

What’s the condition behind the logic?


Which one is the top view of the tower on the left?

26

ANSWER

If, you look at to the tower from the above, the top layer is orange. So, the answer is definitely not C.


Then, the second purple layer will not be seen from the above because it is the same size with the top layer.


And the third layer won't be seen either because it is smaller size then the top two layers.

The fourth layer will be the next one that's going to be seen from the above around the purple layer.


The last one is going to be the largest and it is orange. According to these, the answer is going to be A


media

27

Open Ended

Question image

What’s the condition behind the logic?


Which one is the correct shadow of the animal on the picture?

28

ANSWER


If, there is a rooster on the big picture.


Then, A is a shadow of a seagull, B is a chicken, C is a duck, and D is a rooster.


So, the answer is D.


media

29

Open Ended

Question image

What’s the condition behind the logic?


A person sees this picture on the left from where he/she stands. So, which image is he/she looking at to see that picture?

30

ANSWER


If, you look at the image A on the right side,


Then, you will see the image in the big picture.


media

31

media

32

Open Ended

Question image

How can YOU use the built-in code (predefined functions) that is already part of Python?

33

Multiple Choice

Question image

Which one is NOT true about function?

1

It breaks the large program into small modules.

2

It avoids repetition.

3

It makes code reusable.

4

It makes the program unorganized.

34

Multiple Choice

Question image

Consider the line of code:

drawFramedLabel("Go Team!", 200, 100, "gold")


The code highlighted in blue is best defined as:

1

function name

2

function call

3

function definition

4

arguments

5

parameters

35

Multiple Choice

Question image

When defining a function, the definition must occur before it is called.

1

true

2

false

36

Multiple Choice

Question image

What is a piece of code that can take inputs to perform a certain task?

1

a function

2

arguments

3

parameters

37

Multiple Choice

Question image

Which of the following keywords marks the begining of the function block?

1

Func

2

define

3

def

4

function

38

Multiple Choice

Question image

What does the statement

import math do?

1

This is needed to use the functions in the math module. The math module includes int() and float().

2

This is needed to use the functions in the math module. The math module includes round(), pow() and abs().

3

This is needed to use the functions in the math module. The math module includes floor() and ceil().

4

This is needed to do PEMDAS (order of operations) correctly.

39

Multiple Choice

Question image

import math

x=math.ceil(-4.67)

What is the value of x?

1

-4

2

-5

3

-4.67

4

4.67

40

Multiple Choice

Question image

import math

x=math.floor(-4.67)

What is the value of x?

1

-4

2

-5

3

-4.67

4

4.67

41

Q3 - LESSON 5: PYTHON ACTIVITY 6 - BOOLEAN EXPRESSIONS AND SELECTION STATEMENTS

media

42

LEARNING OBJECTIVES

  • Content:

    ✓ Explain the three types of programming structures

    ✓ Explain how conditional operators and logical operators are used in programming

    ✓ Use conditional operators with strings and numeric values

    ✓ Implement the Python syntax of an if/else statement

    ✓ Determine good test data for programs that include if/else statements

  • Process:

    ✓ Write code that includes if statements and if/else statements

    ✓ Write correct Boolean expressions and compound expressions

media

43

Let's get it on Pythons!

Python Activity 6: Boolean Expressions & Selection Statements

media

44

PYTHON PROGRAMMING SKILLS ASSESSMENT

  • DIRECTIONS: "Let's get it on Pythons!" is a skills assessment designed to measure your proficiency in python programming.

  • Open PYTHON and go new file to open the compiler.

  • This is a time bound type of assessment. The time duration for each item depends on the complexity of the problem.

  • Let's Get it on Pythons!

media

45

Open Ended

Question image

Write a Boolean expression that tests if the value stored in the variable num1 is equal to the value stored in the variable num2.

46

47

Open Ended

Question image

Write a Boolean expression that tests if the value stored in the variable time is less than the value stored in the variable maxTime or if the value stored in the variable cost is less than the value stored in the variable maxCost

48

49

Open Ended

Question image

Write the code for an if statement that adds 5 to the variable num1 if the value stored in the variable testA equals 25. Otherwise subtract 5 from num1.

50

51

Open Ended

Question image

Write the code for an if statement that prints a random number between one and 6 if the value stored in the variable isValid equals the Boolean value true.

52

53

Open Ended

Question image

Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for their payment. If they enter an amount that is less than the total cost of the two items, print a message that tells them how much they still owe. Otherwise, print a message that thanks them for their payment and tells them how much change they will receive. Thoroughly test your code for all possible input.

54

55

Open Ended

Question image

Write a Python program that prompts the user for a word. If the word comes between the word’s apple and pear alphabetically, print a message that tells the user that the word is valid, otherwise, tell the user the word is out or range.

56

57

Open Ended

Question image

Write a Python program that prompts the user for a multiple of 5 between 1 and 100. Print a message telling the user whether the number they entered is valid.

58

59

Let's go deeper Pythons!

Python Activity 6: Boolean Expressions & Selection Statements

media

60

Open Ended

Question image

Which structure best describes the types of Python programs you have written so far? Do you think this structure is the best structure to use for all programs? Why or why not?

61

Open Ended

Question image

What is the result of each of the following expressions?

Assume x = 4, y = 5, z = 4


What is the result of the following expressions?

Assume word1 = “hello”, word2 = “good-bye”

62

Open Ended

Question image

In terms of usage, what are the differences between conditional operators and logical operators?

63

media

64

Attendance Monitoring Program, Class Record Program & Library System

media

65

media

PYTHON PROGRAMMING: HANDS-ON ACTIVITY 5 & 6

LESSON 3: Predefined Functions, Boolean Expressions and Selection Statements

media

Show answer

Auto Play

Slide 1 / 65

SLIDE