_______ is a named group of code that is designed to do a specific task.
What is a function?
Write the operator that is used to check equality.
What is == ?
What are the two boolean values?
What are true and false?
This keyword provides an alternative block if the if-condition is false.
What is else?
This term describes a step-by-step procedure for solving a problem.
What is an algorithm?
_________ is the process of reducing complexity by hiding all unnecessary information and focusing on just what is needed to make it work.
What is abstraction?
The following code is intended to test if x is at least 5. Write the correct symbol:
What is >= ?
A condition using or requires this relationship between multiple conditions.
What is only one condition must be true?
The Boolean operators you can use to combine conditions in an if, elif, or else.
What are and, or, and not?
True or False
Algorithms follow a specific sequence.
What is true?
Which of the following is NOT a function?
a. print()
b. random
c. sqrt()
What is random?
What goes at the end of an if statement line?
What is a colon?
A condition using and requires this relationship between multiple conditions.
What is both conditions have to be true?
You can have multiple of these between an if and an else.
What is are elif statements?
True or False
Algorithms only output strings.
What is false?
The numbers 1 and 5 are examples of _________.
randomNumber = random.randint(1, 5)
What are parameters?
>=
This relational operator means __________.
What is greater than or equal to?
What is the error in this code?
if x > 5 and <= 10:
print("OK")
What is add 'x' after the word and?
What is output?
color = input("What color? ")
if color == "red":
print("Correct")
else:
print("Nope")
elif color == "blue":
print("Correct")
What is there is an error, the else should be after the elif ?
The length of varible names is very important in algorithms.
What is false?
What is the output?
a = 5
b = 2
c = 3
smallest = min(a, b, c)
What is 2?
!=
This relational operator means________.
What is not equal to?
What is the output?
x = -5
y = 10
if x < 0 or y < 0:
print("At least x or y is negative")
What is "At least x or y is negative" ?
What is the output?
x = 6 % 2
if x == 1:
print("ONE")
else:
print("TWO")
What is TWO?
Which of the following are used to compare performance & efficiency of algorithms?
1. Naming Conventions used in the algorithm
2. Speed of the algorithm
3. Memory Use of the algorithm
4. Scalability
5. Number of variables used
6. Security
What are:
2. Speed of the algorithm
3. Memory Use of the algorithm
4. Scalability
6. Security