CISC for Fall 16'

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which mathematical operator is used to raise five to the second power in Python?

**

A value-returning function is ________.

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

The line continuation character is a(n) ________.

/

for num in range (4)

0,1,2,3

for num in range (2, 9, 2)

2, 4, 6, 8

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

A.number = random.randint(1, 50)

6. A=[True], B=['True'] A==B results in True

False

Once generated, a list cannot be grown

False

Once generated, a string is mutable

False

What is the disadvantage of coding in one long sequence structure?

If parts of the duplicated code have to be corrected, the correction has to be made many times.

The variable used to keep the running total is called a(n) ________.

accumulator

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(n) ________.

block

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

boolean

_________ are notes of explanation that document lines or sections of a program.

comments

When the + operator is used with two strings, it performs string __________

concatenation

What type of loop structure repeats the code based on the value of the Boolean expression?

condition-controlled loop

What type of loop structure repeats the code a specific number of times?

count-controlled loop

When a function is called by its name, then it is ________.

executed

True/False: A function definition specifies what a function does and causes the function to execute.

false

True/False: A local variable can be accessed from anywhere in the program.

false

True/False: Python formats all floating-point numbers to two decimal places when outputting using the print statement.

false

True/False: Unlike other languages, in Python, the number of values a function can return is limited to one.

false

After the execution of the following statement, the variable sold will reference the numeric literal value as a(n) ________ data type:sold = 256.752

float

A(n) ________ is a diagram that graphically depicts the steps that take place in a program.

flowchart

In Python, you would use the ________ statement to write a count-controlled loop.

for

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

function

A ________ constant is a global name that references a value that cannot be changed.

global

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

global

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

global

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

header

In a menu-driven program, what statement is used to determine and carry out the user's desired action?

if-elif-else

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

import.random

A(n) ____ loop usually occurs when the programmer forgets to write code inside the loop that makes the test condition false.

infinite

A(n) ____ validation loop is sometimes called an error trap or an error handler

input

The ________ function reads a piece of data that has been entered at the keyboard and returns that piece of data, as a string, back to the program.

input

________ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a computation.

input validation

The ________ built-in function is used to read a number that has been typed on the keyboard.

input()

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

interpreter

In Python, a comma-separated sequence of data items that are enclosed in a set of brackets is called a ________.

list

A(n) ________ variable is created inside a function.

local

What type of error produces incorrect results but does not prevent the program from running?

logic

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

math

A(n) _________ program displays a list of the operations on the screen and allows the user to select the operation that the program should perform.

menu-driven

The approach of ___________makes the program easier to understand, test, and maintain.

modularization

Functions in the standard library are stored in files that are known as ______________

modules

What makes it easier to reuse the same code in more than one program?

modules

The % symbol is the remainder operator and it is also known as the _________ operator.

modulus

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

parameter

The while loop is known as a(n) ____ loop because it tests conditions before performing an iteration

pretest

What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?

pseudocode

What symbol is used to mark the beginning and end of a string?

quotation

The ____ function is a built-in function that generates a list of integer values.

range

What is the structure that causes a statement or a set of statements to execute repeatedly?

repetition

A value-returning function has a(n)_________ statement that returns a value back to the part of the program that called it.

return

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

A(n) ____ total is a sum of numbers that accumulates with each iteration of a loop.

running

A variable's ________ is the part of a program in which the variable may be accessed.

scope

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

scope

A(n) ____ is a special value that marks the end of a sequence of items.

sentinel

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

standard

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

top-down

Which of the following represents an example to calculate the sum of the numbers (accumulator)?

total += number

True/False: A flowchart is a tool that programmers use to design programs.

true

True/False: A value-returning function is like a simple function except that when it finishes it returns a value back to the called part of the program.

true

True/False: Boolean functions are useful for simplifying complex conditions that are tested in decision and repetition structures.

true

True/False: Comments in Python begin with the # character.

true

True/False: Computer programs typically perform three steps: Input is received, some process is performed on the input, and output is produced.

true

True/False: Different functions can have local variables with the same names.

true

True/False: In Python, print statements written on separate lines do not necessarily output on separate lines.

true

True/False: One of the reasons not to use global variables is that it makes a program hard to debug.

true

True/False: Python allows for passing multiple arguments to a function.

true

True/False: Python allows programmers to break a statement into multiple lines.

true

True/False: Python function names follow the same rules for naming variables.

true

True/False: The \t escape character causes the output to skip over to the next horizontal tab.

true

True/False: The function header marks the beginning of the function definition.

true

A(n) __________ is a name that represents a value stored in the computer's memory.

variable

When will the following loop terminate? while keep_on_going != 999:

when keep_on_going refers to a value qual to 999

What is the format for the while clause in Python?

while condition:


Conjuntos de estudio relacionados

Chapter 49 Diabetes Mellitus: Practice Questions

View Set

VIRTUAL ATI PRE ASSESSMENT NURSING CARE OF CHILDREN

View Set

Dallas College week 3 questions intro to networking Protocols and models

View Set

Obesity/ Diabetes/ Liver disease

View Set

6.1.7 Practice Questions Networking Overview

View Set

Critical Reading, Writing, and Thinking

View Set

Gurnick EMB-Lecture 3 (#4 in Moodle)

View Set