Functions
If-Statements
Logical Operators
If-Else and Else-If
Algorithms
100

_______ is a named group of code that is designed to do a specific task.

What is a function?

100

Write the operator that is used to check equality.


What is == ?

100

What are the two boolean values?

What are true and false?

100

This keyword provides an alternative block if the if-condition is false.

What is else?

100

This term describes a step-by-step procedure for solving a problem.

What is an algorithm?

200

_________ 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?

200

The following code is intended to test if x is at least 5. Write the correct symbol:

What is >= ?

200

A condition using or requires this relationship between multiple conditions.

What is only one condition must be true?

200

The Boolean operators you can use to combine conditions in an if, elif, or else.

What are and, or, and not?

200

True or False

Algorithms follow a specific sequence.

What is true?

300

Which of the following is NOT a function?

a. print()

b. random

c. sqrt()

What is random?

300

What goes at the end of an if statement line?

What is a colon?

300

A condition using and requires this relationship between multiple conditions.

What is both conditions have to be true?

300

You can have multiple of these between an if and an else.

What is are elif statements?

300

True or False

Algorithms only output strings.

What is false?

400

The numbers 1 and 5 are examples of _________.


randomNumber = random.randint(1, 5)

What are parameters?

400

>=

This relational operator means __________.

What is greater than or equal to?

400

What is the error in this code?

if x > 5 and  <= 10:
    print("OK")

What is add 'x' after the word and?

400

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 ?

400
True or False

The length of varible names is very important in algorithms.

What is false?

500

What is the output?

a = 5
b = 2
c = 3
smallest = min(a, b, c)

What is 2?

500

!=

This relational operator means________.

What is not equal to?

500

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" ?

500

What is the output?

x = 6 % 2

if x == 1:
   print("ONE")
else:
   print("TWO")

What is TWO?

500

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