

Rock-paper-scissors (microbit)
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
Andy tsui
Used 1K+ times
FREE Resource
11 Slides • 11 Questions
1
Rock-paper-scissors (microbit)

2
Objectives
Define and use variables
Variable data types
Storing input to variable
Conditional Statement
3
What is variable?
Store value in computer program
The value can be coming from input, results of calculations or just anything you want to store
4
Try defining variables in REPL mode
5
Fill in the Blanks
Type answer...
6
Fill in the Blanks
Type answer...
7
Fill in the Blanks
Type answer...
8
Fill in the Blanks
Type answer...
9
Variable types
Each variable, when defined, will be assigned a data type
There are a few data types in Python:
10
Types in python
int or integer
float, which stores numbers with decimals
string, for text, note when referring to string, we need to put a pair of double quote, e.g. "This is string", "10"
bool, stands for boolean
11
Boolean
Boolean is a special type that allows two possible values only: True and False
Boolean is for logical statement
12
Multiple Choice
What is the data type for the following variable A:
A = 15
int
float
string
boolean
13
Multiple Choice
What is the data type for the following variable A:
A = 1.5
int
float
string
boolean
14
Multiple Choice
What is the data type for the following variable A:
A = "15"
int
float
string
boolean
15
Multiple Choice
What is the data type for the following variable A:
A = True
int
float
string
boolean
16
Multiple Choice
What is the data type for the following variable A:
A = 3 > 4
int
float
string
boolean
17
Getting button press in Microbit
Try in REPL mode
18
Open Ended
Quick Review:
What is the command if we want to output a string "X" on the microbit LEDs?
19
Rock paper scissors device - 1
IF Button A is pressed, then display "R"
IF Button B is pressed, then display "P"
20
Open Ended
What is the logical statement, if we want to know if both button A and B is pressed?
21
Now complete the Program
also Add Press A+B will display "S"
22
Extended Activity
Try, instead of displaying text, display an image to represent Rock paper and scissors
Refer to the following document:
https://microbit-micropython.readthedocs.io/en/stable/tutorials/images.html
Rock-paper-scissors (microbit)

Show answer
Auto Play
Slide 1 / 22
SLIDE
Similar Resources on Wayground
20 questions
Algebra 1 Final Exam Review
Presentation
•
9th Grade
18 questions
Writing Linear Application Equations and Inequalities
Presentation
•
9th Grade
16 questions
The Scientific Method and Experimental Design
Presentation
•
9th Grade
17 questions
Solve Systems of Inequalities by Graphing
Presentation
•
9th - 10th Grade
19 questions
Lesson 24 Adding Polynomials
Presentation
•
9th Grade
17 questions
Graphing + Data Analysis Review
Presentation
•
8th - 10th Grade
16 questions
Introduction to Plate Tectonics
Presentation
•
8th Grade
15 questions
Solving Multi-Step Equations Practice
Presentation
•
8th Grade
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
10 questions
Fire Prevention
Quiz
•
9th - 12th Grade
24 questions
BIOLOGY STAAR REVIEW
Quiz
•
9th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
30 questions
English 1 STAAR Review
Quiz
•
9th Grade
46 questions
Linear and Exponential Function Key Features
Quiz
•
9th Grade
20 questions
Grammar
Quiz
•
9th - 12th Grade
30 questions
Biology STAAR Review #3
Quiz
•
9th Grade