

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
Output devices
Presentation
•
9th Grade
18 questions
Storage Devices
Presentation
•
8th Grade
17 questions
Protein Synthesis Final
Presentation
•
9th Grade
17 questions
Function Notation
Presentation
•
9th Grade
18 questions
Bacteria and Viruses
Presentation
•
9th Grade
18 questions
REPORT TEXT
Presentation
•
9th Grade
18 questions
Grammar Basics
Presentation
•
9th Grade
18 questions
Overview of HTML
Presentation
•
9th Grade
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade
Discover more resources for Computers
10 questions
Fact Check Ice Breaker: Two truths and a lie
Quiz
•
5th - 12th Grade
10 questions
Video Games
Quiz
•
6th - 12th Grade
10 questions
Logos
Quiz
•
6th - 9th Grade
10 questions
Test Your Knowledge with 15 Fun Trivia Questions
Interactive video
•
6th - 10th Grade
15 questions
Memorial Day Trivia
Quiz
•
KG - 12th Grade
21 questions
Factoring Trinomials (a=1)
Quiz
•
9th Grade
12 questions
Name that Candy
Quiz
•
KG - 12th Grade
20 questions
Guess The App
Quiz
•
KG - Professional Dev...