3.5 Lesson Practice

Question: 3.1 Lesson Practice

A ____________ is a set of commands which can be run by calling it by name.

Answer: function

Question: 3.1 Lesson Practice

A _____________ is a piece of information sent to a function.

Answer: parameter

Question: 3.1 Lesson Practice

Consider the following code:

x = random.randint (1, 100)

The randint is a ____________.

Answer: function

Question: 3.1 Lesson Practice

Which of the following is NOT a function?

Answer: math

Question: 3.2 Lesson Practice

For questions 1-3, consider the following code:

What is output if the user types in 9? Click all that apply.

Answer: C

D

A

Question: 3.2 Lesson Practice

What is output if the user types in 8? Click all that apply.

Answer: C

Question: 3.2 Lesson Practice

What is output if the user types in 13? Click all that apply.

Answer: A

D

B

Question: 3.2 Lesson Practice

The following code is intended to test if x is NOT less than 17. Fill in the correct symbol:

if (x ____ 17):

Answer: >=

Question: 3.2 Code Practice: Question 1

Answer: n = float(input(“Enter a number: “))

if (n>45.6):

print(“Greater than 45.6”)

if(n<45.6):

print(“Less than 45.6”)

Question: 3.2 Code Practice: Question 2

Answer: a = float(input(‘Enter a number: ‘)) i

f(a >= 90):

print(‘Great!’)

Donation Page

Support Our Work

Do you appreciate the value this website provides? If so, please consider donating to help keep it running. Your donation will go a long way in helping us continue to provide the same quality of content and services. Every bit helps, and your support is greatly appreciated. Thank you for your generosity.