For some IF statements, we use compound conditions (two or more). Given that you had an IF statement where both X and Y had to be true, which of the following will give you a result of true?
Python Programming (non-OO) Final Review

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Brett Kottmann
Used 3+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
X=T, Y=F
X=T, Y=T
X=F, Y=T
X=F, Y=F
Answer explanation
Only if both X and Y are true will you get a result of true.
A good tool is a "truth table" were you write out the possible X and Y combinations and their results. Note that the "^" symbol means "and". The "v" symbol means "or".
You can also have a "not" operator (sometimes represented with a "!" or "~" symbol) which negates the result, so true becomes false, etc.
2.
DRAG AND DROP QUESTION
30 sec • 5 pts
Software repositories like Git act as (a) systems, making sure only one person has access to a file at a time.
Answer explanation
Version control makes sure only one person has access to a file at a time, preventing accidental overwrites.
It can also help with software version releases and archiving by keeping separate versions available.
3.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Variables act like named memory locations in your computer. When is a variable created?
When designed
When tested
When called
When instantiated (declared)
Answer explanation
Variables (objects) are created in the computer when they are declared (or instantiated).
The following all create variables or objects:
int x = -5
y = 14.8
my_list = [one, two, three]
m = n = "Hello"
These do not:
int z
float price, quantity
because they are never assigned values. If you try to use them you will get an error:
int x = z
for example.
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is a step-by-step English description of a task called?
Algorithm
List
Flowchart
Goal
Answer explanation
An English step-by-step description of a task is an algorithm.
Not to be confused with a flowchart (a visual representation of the flow of a program) or psuedocode (generic code-like steps for an algorithm or flowchart).
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
If you want to re-use a chunk of code to compute and return a result, what should you use?
Function
Loop
Branch
Block
Answer explanation
Code that is to be re-used should be put into a function, (also known as a method) which allows you to "call" it from anywhere in your code.
Functions usually return a value, but do not have to. Functions inside classes or associated with objects are usually referred to as methods of the class/object.
In some languages you will also see the term procedure, which usually means a function (or method) that does not return a value, but may alter the variables passed to it. Many programmers use all of these terms interchangeably.
6.
DRAG AND DROP QUESTION
1 min • 1 pt
Testing a condition to determine which block of code to execute is known as
(a) .
Answer explanation
In a class diagram, the bottom row is always the class methods (functions).
7.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is a simple way of adding strings together (catenating or concatenating strings)?
Using the "+" sign
Using several " marks
Usings a built-in function
You cannot add strings together
Answer explanation
A simple way of adding strings together is to use the "+" sign.
"Hello" + "World" results in "HelloWorld"
"Hello" + " " + "World" results in "Hello World".
You can also use string variables.
String my_string = "World!"
"Hello" + " " + my_string results in "Hello World!"
Note the use of " " to add spaces!
Create a free account and access millions of resources
Similar Resources on Quizizz
37 questions
CSS and HTML Vocabulary

Quiz
•
9th - 12th Grade
41 questions
Unit 0 / Unit 1 Mid Point Formative Assessment

Quiz
•
10th Grade
40 questions
CodeHS Web Design - HTML - Mid-Unit Test

Quiz
•
9th - 12th Grade
40 questions
GCSE Comp Sci - Unit 3 Computers

Quiz
•
10th Grade
37 questions
OCR H446 - 2.2 Problem Solving and Programming - Algorithms - 02

Quiz
•
12th Grade
42 questions
Cybersecurity Sem 2

Quiz
•
9th Grade
37 questions
IC3 GS6 Domain 1 Assessment

Quiz
•
6th - 12th Grade
44 questions
AP CSP - Unit 4 Code.org Review

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade