Intro to Programming Quiz 5 Study Questions

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What does the following statement mean? num1, num2 = get_num()

The function get_num() is expected to return a value for num1 and for num2.

What is a group of statements that exists within a program for the purpose of performing a specific task?

a function

A value-returning function is

a function that will return a value back to the part of the program that called it

A(n) ________ is any piece of data that is passed into a function when the function is called.

argument

A set of statements that belong together as a group and contribute to the function definition is known as a

block

What will be displayed after the following code is executed? def pass_it(x, y): z = x*y result = get_result(z) return(result) def get_result(number): z = number + 2 return(z) num1 = 3 num2 = 4 answer = pass_it(num1, num2) print(answer)

14

What will display after the following code is executed? def main(): print("The answer is", magic(5)) def magic(num): answer = num + 2 * 10 return answer main()

25

What will be the output after the following code is executed? def pass_it(x, y): z = y**x return(z) num1 = 3 num2 = 4 answer = pass_it(num1, num2) print(answer)

64

What type of function can be used to determine whether a number is even or odd?

Boolean

What will be the output after the following code is executed? def pass_it(x, y): z = x + ", " + y return(z) name2 = "Tony" name1 = "Gaddis" fullname = pass_it(name1, name2) print(fullname)

Gaddis, Tony

What will be the output after the following code is executed? def pass_it(x, y): z = x , ", " , y num1 = 4 num2 = 8 answer = pass_it(num1, num2) print(answer)

None

A ________ constant is a name that references a value that cannot be changed while the program runs.

global

A ________ variable is accessible to all the functions in a program file.

global

It is recommended that programmers avoid using ________ variables in a program whenever possible.

global

The first line in a function definition is known as the function

header

A(n) ________ chart is also known as a structured chart.

hierarchy

Which of the following statements causes the interpreter to load the contents of the random module into memory?

import random

The Python library functions that are built into the Python ________ can be used by simply calling the required function.

interpreter

A ________ variable is created inside a function.

local

The Python standard library's ________ module contains numerous functions that can be used in mathematical calculations.

math

Which of the following will assign a random integer in the range of 1 through 50 to the variable number?

number = random.randint(1, 50)

A(n) ________ is a variable that receives an argument that is passed into a function.

parameter

In a value-returning function, the value of the expression that follows the keyword ________ will be sent back to the part of the program that called the function.

return

The ________ of a local variable is the function in which that variable is created.

scope

Python comes with ________ functions that have already been prewritten for the programmer.

standard

The ________ design technique can be used to break down an algorithm into functions.

top-down

Which of the following functions returns the largest integer that is less than or equal to its argument?

floor

When a function is called by its name during the execution of a program, then it is

executed


Set pelajaran terkait

CSC 202 Final (Made with Parkinson's Quiz questions)

View Set

skabidi toilet only in ohio kai cenat baby gronk w grimace shake rizz skibidi ohio rizzler gyattt ohio rizzler baby gronk skibidi toilet ohio rizz

View Set

PAD 4144 Intro to Non Profit FINAL

View Set

CIS 330 Chapter 9, 10, 11 (Final Exam)

View Set

W1SQ: The Declaration of Independence

View Set

Microbiology Chapter 3 HW, Microbiology Chapter 4 Part 2 HW, Microbiology Chapter 4 Part 1 HW

View Set

Exam 3 Study Guide (Ch. 9, 13, 14, 16)

View Set

Anatomy- Chapter 7 Quizlet (actual test questions)

View Set