SCRATCH
PYTHON BASICS
VARIABLES & INPUT
OPERATORS & DATA TYPES
HOW PROGRAMS RUN
100

What type of programming language is Scratch?

A block-based programming language.

100

Is Python block-based or text-based?

Text-based

100

What Python command gets information typed by the user?

input()

100

What data type is "Hello"?

String

100

What is source code?

Human-readable code written by a programmer.

200

What happens when the green flag is clicked in a Scratch program?

The program starts running.

200

What command displays something on the screen in Python?

print()

200

What does this code do?

name = input("What is your name? ")

It asks the user for their name and stores the response in name.

200

What data type is 25?

Integer

200

What does machine code consist of?

Binary instructions using 0s and 1s

300

What are three examples of inputs in Scratch?

Touching the screen, clicking the mouse, and typing on the keyboard.

300

What is wrong with this code?

Print("Hello")

Print should be lowercase: print()

300

What symbol is used to assign a value to a variable in Python?

=

300

What data type is 3.14?

Float

300

What does a compiler do?

It translates the whole program before it runs into an executable form.

400

What is a variable used for?

To store a value that can be used later.

400

Why must text normally be placed inside quotation marks in Python?

Quotation marks tell Python that the value is a text/string

400

Give two rules for naming Python variables.

No spaces; use letters, numbers, and underscores; start with a letter.

400

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

400

What does an interpreter do?

It translates and runs source code one line at a time.

500

What does the join operator do?

It combines two words or variables to create a new word/string.

500

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.

500

What type of data does input() always return?

A string

500

What function converts a value into an integer?

int()

Bonus acceptable answers: float() converts to a float, and str() converts to a string.

500

Which one is easier for beginners to create visually: Scratch or Python?

Scratch

M
e
n
u