
Python Button Logic Quiz

Quiz
•
Computers
•
6th - 10th Grade
•
Medium
Fadi Fadi
Used 2+ times
FREE Resource
29 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code display when Button A is pressed?
if button_a.is_pressed():
display.show("A")
An icon
"A"
Nothing
"B"
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly checks if Button B is pressed?
if button_b.press():
if button_b == True:
if button_b.is_pressed():
if button_b.pressed():
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if both Button A and Button B are pressed in the following code?
if button_a.is_pressed():
display.show("A")
elif button_b.is_pressed():
display.show("B")
"B" will be displayed
Nothing will be displayed
Both "A" and "B" will be displayed
"A" will be displayed
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code display if no buttons are pressed? if button_a.is_pressed(): display.show("A") elif button_b.is_pressed(): display.show("B") else: display.show("?")
"B"
"?"
Nothing
"A"
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which code snippet will display a happy icon if Button A is pressed?
if button_a.is_pressed(): display.show(Image.HAPPY)
if button_a.is_pressed() == True: display.show(Image.HAPPY)
if button_a.is_pressed(); display.show(Image.HAPPY)
if button_a.pressed(): display.show(Image.HAPPY)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code when Button B is pressed?
if button_a.is_pressed():
display.show("A")
else: display.show("B")
"A"
"B"
Nothing
"A" and "B"
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the Micro display when both buttons are pressed in this code?
if button_a.is_pressed():
display.show("A")
if button_b.is_pressed():
display.show("B")
"A"
"B"
Both "A" and "B" at the same time
"A" followed by "B"
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Internet quiz for computer skills YDD

Quiz
•
6th Grade - University
25 questions
Excel

Quiz
•
7th Grade
30 questions
Micro:bit Introduction Quiz

Quiz
•
9th Grade - University
24 questions
Micro:bit Functions Quiz

Quiz
•
6th - 10th Grade
26 questions
mBot Review (through distance sensor)

Quiz
•
6th - 8th Grade
24 questions
1A Quiz on Game Design with Scratch

Quiz
•
5th - 9th Grade
27 questions
Introduction to VB6

Quiz
•
10th Grade
30 questions
Microsoft Word Unit Review

Quiz
•
8th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
typing

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade