Font size
WorksheetsU1/L4 - Variables Lesson- Python Course
Total questions: 50
Worksheet time: 31mins
1) __________ help you store data so that you can use it later on in the program.
Variables
Functions
Loops
Operators
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.
variable
function
loop
constant
You can think of a variable as a __________ with a label on it.
box
book
pen
folder
You can use a plus sign to combine player_name with your text because they are both __________.
strings
numbers
lists
booleans
Whenever you have a variable, it’s always going to hold the most __________ value that you assign it.
recent
oldest
random
average
When you change the name of the variable, you need to change __________ that variable is used.
everywhere
sometimes
nowhere
rarely
You can double the score by multiplying the integer variable by __________.
2
0
1
10
Score = score * 2 means 2 times whatever value the score had __________ you multiplied it by 2.
before
after
during
unless
You can use variables to store the __________ of mathematical operations.
results
names
colors
sizes
The variable bonus_helping_animal is equal to __________.
10
50
2
20
__________ is a process where you go through the program to see what the most recent value of a variable is.
Program tracing
Program compiling
Program debugging
Program executing
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 __________.
integer, string
string, integer
float, boolean
list, tuple
In a printf command, you can surround a variable with __________ to print the value.
quotes
parentheses
curly brackets
braces
If you forget the end quote you will get an __________.
error
warning
output
comment
There are ________ and ________ for naming variables to make things easier to understand.
rules, traditions
numbers, symbols
colors, shapes
tables, charts
Putting an ________ between the words in a variable is called underscore naming.
underscore
hyphen
space
dot
Camel case is when you ________ the start of every word.
capitalize
underline
italicize
bold
A ______ is a term we use in AI to describe a specific characteristic that a computer needs to make a decision.
feature
algorithm
database
output
You_______ start variables with a letter or number and you ___________start with number or other character.
can; cannot
should; should not
must; must not
cannot; can
If you want to diagnose a patient's illness you are going to need to collect characteristics that can be stored as a__________.
variable
number
code
syntax
What is the primary function of a programming language?
To design hardware
To provide instructions to a computer
To create images
To browse the internet
What is a print statement used for in programming?
To save data
To display output
To delete files
To calculate numbers
Identify TWO basic components of a program in Platypus Programming. (Select TWO answers)
Print statements
Loops
Power supply
Memory allocation
Which term describes the process of creating a set of instructions for computers?
• A) Debugging
• B) Compiling
• C) Programming
• D) Testing
In Platypus Programming, which feature helps beginners learn coding?
• A) Complex algorithms
• B) Beginner-friendly interface
• C) Advanced graphics
• D) Multiplayer mode
What is an algorithm?
A) A type of computer
B) A step-by-step procedure for solving a problem
C) An error in code
D) A programming language
What is the primary goal of debugging?
A) To add new features
B) To remove errors from code
C) To write user manuals
D) To compile the program
Which TWO of the following are common errors in algorithms? (Select TWO answers)
A) Logical errors
B) Compilation errors
C) Syntax errors
D) Algorithm errors
Why is user input important in a program?
A) It helps with code debugging
B) It allows programs to interact with users
C) It speeds up program execution
D) It simplifies algorithm design
Which of the following best describes efficiency in algorithms?
A) Using the least amount of code
B) Solving a problem with minimal time and effort
C) Writing the most complex code
D) Debugging the code
Which of the following best describes the purpose of a flowchart?
To create a visual representation of a program’s user interface
To map out the steps of an algorithm or process
To generate random data for testing algorithms
a chart that flows..... DO NOT PICK ME!
True or False. Debugging is only necessary after an algorithm has been fully implemented. (a)
Which programming language is often used for web development?
• A) HTML
• B) Python
• C) JavaScript
• D) COBOL
Why is it important to choose the right programming language for a project?
• A) It affects code readability
• B) It changes the hardware requirements
• C) It determines the project's success
• D) It impacts the color scheme
What is the binary representation of the decimal number 5?
• A) 1010
• B) 1001
• C) 0101
• D) 0011
How is the letter 'E' encoded in Morse Code?
• A) .-
• B) -
• C) .
• D) --
Convert the binary number 1101 to decimal.
• A) 10
• B) 13
• C) 15
• D) 12
What is the primary purpose of using binary numbers in computers?
• A) To save memory space
• B) To simplify calculations
• C) To process text faster
• D) To represent data using two states
Which TWO of the following are binary representations? (Select TWO answers)
• A) 1101
• B) 8F
• C) 100110
• D) 7B
What is a variable in programming?
• A) A complex algorithm
• B) A named storage location
• C) A random number generator
• D) A type of software
Who is known as the "father of the computer"?
• A) Bill Gates
• B) Charles Babbage
• C) Steve Jobs
• D) Alan Turing
Which of these is considered the first electronic general-purpose computer?
• A) ENIAC
• B) UNIVAC
• C) IBM PC
• D) Altair 8800
Select TWO key innovations in computer history. (Select TWO answers)
• A) The development of the internet
• B) The creation of the abacus
• C) The invention of the microprocessor
• D) The discovery of electricity
In a "Platypus Loop" scenario, which THREE actions are crucial? (Select THREE answers)
• A) Initializing variables
• B) Creating infinite loops
• C) Checking conditions
• D) Iterating effectively
Which strategy best describes optimizing an algorithm for efficiency?
• A) Adding more loops
• B) Reducing execution time
• C) Increasing code length
• D) Using more variables
Select TWO reasons why loops are used in algorithms. (Select TWO answers)
• A) To make algorithms slower
• B) To repeat tasks efficiently
• C) To reduce code complexity
• D) To increase memory usage
Which term describes a programming construct that repeats a block of code?
• A) Condition
• B) Loop
• C) Variable
• D) Function
I am in (a) grade at PFJH. I also have classes at (b)
The best Computer Science Teacher is (a)
Reorder the following Computational Thinking Goals for the Year.
Algorithm
Pattern Recognition
Decomposition
Abstraction
Graduate CS Class
