What type of programming language is Scratch?
A block-based programming language.
Is Python block-based or text-based?
Text-based
What Python command gets information typed by the user?
input()
What data type is "Hello"?
String
What is source code?
Human-readable code written by a programmer.
What happens when the green flag is clicked in a Scratch program?
The program starts running.
What command displays something on the screen in Python?
print()
What does this code do?
name = input("What is your name? ")
It asks the user for their name and stores the response in name.
What data type is 25?
Integer
What does machine code consist of?
Binary instructions using 0s and 1s
What are three examples of inputs in Scratch?
Touching the screen, clicking the mouse, and typing on the keyboard.
What is wrong with this code?
Print("Hello")
Print should be lowercase: print()
What symbol is used to assign a value to a variable in Python?
=
What data type is 3.14?
Float
What does a compiler do?
It translates the whole program before it runs into an executable form.
What is a variable used for?
To store a value that can be used later.
Why must text normally be placed inside quotation marks in Python?
Quotation marks tell Python that the value is a text/string
Give two rules for naming Python variables.
No spaces; use letters, numbers, and underscores; start with a letter.
Why does this program produce 8090 instead of 170?
number1 = input("Enter a number ")
number2 = input("Enter a number ")
total = number1 + number2
input() produces strings, so Python joins the two values instead of adding them numerically
What does an interpreter do?
It translates and runs source code one line at a time.
What does the join operator do?
It combines two words or variables to create a new word/string.
Name three common mistakes that can cause a Python program to produce an error.
Incorrect spelling, incorrect capitalization, missing brackets, missing quotation marks, or missing symbols.
What type of data does input() always return?
A string
What function converts a value into an integer?
int()
Bonus acceptable answers: float() converts to a float, and str() converts to a string.
Which one is easier for beginners to create visually: Scratch or Python?
Scratch