Search Header Logo
Guess Which Color - SPIKE™ Prime with Python

Guess Which Color - SPIKE™ Prime with Python

Assessment

Presentation

Engineering

8th Grade

Practice Problem

Easy

Created by

Heiko Olschewski

Used 6+ times

FREE Resource

10 Slides • 11 Questions

1

media

2

media

3

Multiple Choice

Why is it important to use conditional statements when programming a color sensor in Python?

1

They allow the program to make decisions based on sensor input.

2

They make the code run faster without any logic.

3

They are only used for debugging purposes.

4

They help to create random outputs.

4

media

5

Fill in the Blanks

6

Multiple Choice

Which symbol in a flowchart is used to show a decision to be made or a condition to be met?

1

Oval

2

Diamond

3

Rectangle

4

Parallelogram

7

media

8

Multiple Choice

Question image

Based on the flowchart, what happens if the color sensor detects blue?

1

Play Sound Dog Bark and Print What happened?

2

Play Sound Bird and Print Detected Blue

3

Play Sound Angry Cat and Print Detected Green

4

Play Sound Dog Barking and Print Detected Yellow

9

media

10

Multiple Select

Question image

Which of the following actions can occur if the color sensor does NOT detect blue, according to the second flowchart?

1

Play Sound Bird and Print Detected Blue

2

Play Sound Angry Cat and Print Detected Green

3

Play Sound Dog Barking and Print Detected Yellow

4

Print Detected Blue

11

Open Ended

Looking at both flowcharts, what is the main difference between the two in terms of decision-making?

12

media
media

13

Multiple Choice

What is the main purpose of using the 'elif' statement in the traffic light code shown?

1

To repeat the same action multiple times

2

To check multiple conditions in sequence

3

To end the program after one cycle

4

To print messages to the console

14

media
media
media
media
media
media

​You also need the traffic_light() function from earlier.












Then do runloop.run(traffic_light(), main())

15

Flowchart for part 1

media

16

Fill in the Blanks

media image

17

Multiple Select

Which of the following actions are performed by the traffic light code across both functions?

1

Cycle through green, yellow, and red lights

2

Check for special conditions using a color sensor

3

Print messages based on the current light state

4

Take a video of the traffic light

18

media

19

media

20

Open Ended

Why would you want to include if/else and elif statements in programs?

21

Open Ended

How do you think using conditional code with a color sensor can help you in creating interactive games or projects?

media

Show answer

Auto Play

Slide 1 / 21

SLIDE