wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

U1/L4 - Variables Lesson- Python Course

Total questions: 50

Worksheet time: 31mins

Name
Class
Date
1.

1) __________ help you store data so that you can use it later on in the program.

a)

Variables

b)

Functions

c)

Loops

d)

Operators

2.

You could use a __________ to store that name so that you didn't have to manually replace the name each time it appears in the code.

a)

variable

b)

function

c)

loop

d)

constant

3.

You can think of a variable as a __________ with a label on it.

a)

box

b)

book

c)

pen

d)

folder

4.

You can use a plus sign to combine player_name with your text because they are both __________.

a)

strings

b)

numbers

c)

lists

d)

booleans

5.

Whenever you have a variable, it’s always going to hold the most __________ value that you assign it.

a)

recent

b)

oldest

c)

random

d)

average

6.

When you change the name of the variable, you need to change __________ that variable is used.

a)

everywhere

b)

sometimes

c)

nowhere

d)

rarely

7.

You can double the score by multiplying the integer variable by __________.

a)

2

b)

0

c)

1

d)

10

8.

Score = score * 2 means 2 times whatever value the score had __________ you multiplied it by 2.

a)

before

b)

after

c)

during

d)

unless

9.

You can use variables to store the __________ of mathematical operations.

a)

results

b)

names

c)

colors

d)

sizes

10.

The variable bonus_helping_animal is equal to __________.

a)

10

b)

50

c)

2

d)

20

11.

__________ is a process where you go through the program to see what the most recent value of a variable is.

a)

Program tracing

b)

Program compiling

c)

Program debugging

d)

Program executing

12.

A Better Way to Print with Variables: 1) We get an error because score contains an __________ and we are trying to add it to a __________.

a)

integer, string

b)

string, integer

c)

float, boolean

d)

list, tuple

13.

In a printf command, you can surround a variable with __________ to print the value.

a)

quotes

b)

parentheses

c)

curly brackets

d)

braces

14.

If you forget the end quote you will get an __________.

a)

error

b)

warning

c)

output

d)

comment

15.

There are ________ and ________ for naming variables to make things easier to understand.

a)

rules, traditions

b)

numbers, symbols

c)

colors, shapes

d)

tables, charts

16.

Putting an ________ between the words in a variable is called underscore naming.

a)

underscore

b)

hyphen

c)

space

d)

dot

17.

Camel case is when you ________ the start of every word.

a)

capitalize

b)

underline

c)

italicize

d)

bold

18.

A ______ is a term we use in AI to describe a specific characteristic that a computer needs to make a decision.

a)

feature

b)

algorithm

c)

database

d)

output

19.

You_______ start variables with a letter or number and you ___________start with number or other character.

a)

can; cannot

b)

should; should not

c)

must; must not

d)

cannot; can

20.

If you want to diagnose a patient's illness you are going to need to collect characteristics that can be stored as a__________.

a)

variable

b)

number

c)

code

d)

syntax

21.

What is the primary function of a programming language?

a)

To design hardware

b)

To provide instructions to a computer

c)

To create images

d)

To browse the internet

22.

What is a print statement used for in programming?

a)

To save data

b)

To display output

c)

To delete files

d)

To calculate numbers

23.

Identify TWO basic components of a program in Platypus Programming. (Select TWO answers)

a)

Print statements

b)

Loops

c)

Power supply

d)

Memory allocation

24.

Which term describes the process of creating a set of instructions for computers?

a)

• A) Debugging

b)

• B) Compiling

c)

• C) Programming

d)

• D) Testing

25.

In Platypus Programming, which feature helps beginners learn coding?

a)

• A) Complex algorithms

b)

• B) Beginner-friendly interface

c)

• C) Advanced graphics

d)

• D) Multiplayer mode

26.

What is an algorithm?

a)
  • A) A type of computer

b)
  • B) A step-by-step procedure for solving a problem

c)
  • C) An error in code

d)
  • D) A programming language

27.

What is the primary goal of debugging?

a)
  • A) To add new features

b)
  • B) To remove errors from code

c)
  • C) To write user manuals

d)
  • D) To compile the program

28.

Which TWO of the following are common errors in algorithms? (Select TWO answers)

a)
  • A) Logical errors

b)
  • B) Compilation errors

c)
  • C) Syntax errors

d)
  • D) Algorithm errors

29.

Why is user input important in a program?

a)
  • A) It helps with code debugging

b)
  • B) It allows programs to interact with users

c)
  • C) It speeds up program execution

d)
  • D) It simplifies algorithm design

30.

Which of the following best describes efficiency in algorithms?

a)
  • A) Using the least amount of code

b)
  • B) Solving a problem with minimal time and effort

c)
  • C) Writing the most complex code

d)
  • D) Debugging the code

31.

Which of the following best describes the purpose of a flowchart?

a)

To create a visual representation of a program’s user interface

b)

To map out the steps of an algorithm or process

c)

To generate random data for testing algorithms

d)

a chart that flows..... DO NOT PICK ME!

32.

True or False. Debugging is only necessary after an algorithm has been fully implemented. ​ ​ ​ (a)  

Choose from the below words
True
False
33.

Which programming language is often used for web development?

a)

• A) HTML

b)

• B) Python

c)

• C) JavaScript

d)

• D) COBOL

34.

Why is it important to choose the right programming language for a project?

a)

• A) It affects code readability

b)

• B) It changes the hardware requirements

c)

• C) It determines the project's success

d)

• D) It impacts the color scheme

35.

What is the binary representation of the decimal number 5?

a)

• A) 1010

b)

• B) 1001

c)

• C) 0101

d)

• D) 0011

36.

How is the letter 'E' encoded in Morse Code?

a)

• A) .-

b)

• B) -

c)

• C) .

d)

• D) --

37.

Convert the binary number 1101 to decimal.

a)

• A) 10

b)

• B) 13

c)

• C) 15

d)

• D) 12

38.

What is the primary purpose of using binary numbers in computers?

a)

• A) To save memory space

b)

• B) To simplify calculations

c)

• C) To process text faster

d)

• D) To represent data using two states

39.

Which TWO of the following are binary representations? (Select TWO answers)

a)

• A) 1101

b)

• B) 8F

c)

• C) 100110

d)

• D) 7B

40.

What is a variable in programming?

a)

• A) A complex algorithm

b)

• B) A named storage location

c)

• C) A random number generator

d)

• D) A type of software

41.

Who is known as the "father of the computer"?

a)

• A) Bill Gates

b)

• B) Charles Babbage

c)

• C) Steve Jobs

d)

• D) Alan Turing

42.

Which of these is considered the first electronic general-purpose computer?

a)

• A) ENIAC

b)

• B) UNIVAC

c)

• C) IBM PC

d)

• D) Altair 8800

43.

Select TWO key innovations in computer history. (Select TWO answers)

a)

• A) The development of the internet

b)

• B) The creation of the abacus

c)

• C) The invention of the microprocessor

d)

• D) The discovery of electricity

44.

In a "Platypus Loop" scenario, which THREE actions are crucial? (Select THREE answers)

a)

• A) Initializing variables

b)

• B) Creating infinite loops

c)

• C) Checking conditions

d)

• D) Iterating effectively

45.

Which strategy best describes optimizing an algorithm for efficiency?

a)

• A) Adding more loops

b)

• B) Reducing execution time

c)

• C) Increasing code length

d)

• D) Using more variables

46.

Select TWO reasons why loops are used in algorithms. (Select TWO answers)

a)

• A) To make algorithms slower

b)

• B) To repeat tasks efficiently

c)

• C) To reduce code complexity

d)

• D) To increase memory usage

47.

Which term describes a programming construct that repeats a block of code?

a)

• A) Condition

b)

• B) Loop

c)

• C) Variable

d)

• D) Function

48.

I am in (a)   grade at PFJH. I also have classes at​ (b)  

Choose from the below words
9th
PFHS
10th
8th
SCJH
GPHS
49.

The best Computer Science Teacher is (a)  

Choose from the below words
Mrs. Parton
Mrs. Latham
Sapil
Mr. Britton
Mr. Harper
50.

Reorder the following Computational Thinking Goals for the Year.

a)

Algorithm

b)

Pattern Recognition

c)

Decomposition

d)

Abstraction

e)

Graduate CS Class

1)
2)
3)
4)
5)