Python Final Review

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

In Python, the ________ symbol is used as the not-equal-to operator.

!=

What is the largest value that can be stored in one byte?

255

After the execution of the following statement, the variable price will reference the value _____. price=int(68.549)

68

Which of the following is not an augmented assignment operator? /= <= += *=

<=

Which language is referred to as a low-level language?

Assembly language

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

Boolean

Which of the following is not a microprocessor manufacturing company? -Motorola -AMD -Dell -Intell

Dell

Which of the following is considered to be the world's first programmable electronic computer?

ENIAC

A bit that is turned off is represented by the value -1. (TRUE OR FALSE)

FALSE

A function definition specifies what a function does and causes the function to execute. (TRUE or FALSE)

False

A hierarchy chart shows all the steps that are taken inside a function. (TRUE or FALSE)

False

A local variable can be accessed from anywhere in the program. (TRUE or FALSE)

False

A while loop is called a pretest loop because the condition is tested after the loop has had one iteration. (TRUE or FALSE)

False

Functions can be called from statements in the body of a loop and loops can be called from within the body of a function. (TRUE or FALSE)

False

In Python there is no restriction on the name of a module file. (TRUE or FALSE)

False

In Python, an infinite loop usually occurs when the computer accesses an incorrect memory address. (TRUE or FALSE)

False

The NOT operator is a unary operator, meaning it takes only one operand. (TRUE or FALSE)

False

The Python language uses a compiler which is a program that both translates and executes the instruction in a high-level language. (TRUE or FALSE)

False

The first line in a while loop in referred to as the condition clause. (TRUE or FALSE)

False

The math function atan(x) returns one tangent of x in radians. (TRUE or FALSE)

False

Unlike other languages, in Python the number of values a function can return is limited to one. (TRUE or FALSE)

False

In a value-returing function, the value of the expression that follows the keyboard _____ will be sent back to the part of the program that called the function.

Return

A good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a loop that will repeat as many times as necessary. (TRUE or FALSE)

True

A software developer is the person with the training to design, create, and test computer programs. (TRUE OR FALSE)

True

Expressions that are tested by the if statements are called Boolean expressions. (TRUE or FALSE)

True

IDLE is an alternative method to using a text editor to write, execute, and test a Python program. (TRUE or FALSE)

True

Nested decision statements are one way to test more than one condition. (TRUE OR FALSE)

True

Reducing duplication of code is one of the advantages of using a loop structure. (TRUE or FALSE)

True

The integrity of a program's output is only as good as the integrity of its input. For this reason, the program should discard input that is invalid and prompt the user to enter valid data. (TRUE or FALSE)

True

The math function ceil(x) returns the smallest integer that is greater than or equal to x. (TRUE or FALSE)

True

the \t escape character causes the output to skip over to the next horizontal tab. (TRUE or FALSE)

True

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

a function

When using the _____ logical operator, both subexpressions must be true for the compound expression to be true.

and

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

argument

The smallest storage location in a computer's memory is known as a

bit

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

block

Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions.

compound

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

condition controlled loop

A(n) _____ structure is a logical design that controls the order in which a set of statements execute.

control

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

count controlled loop

The decision structure that has two possible paths of execution is known as _____.

dual alternative

In a print statement, you can set the _____ argument to a space or empty string to stop the output from advancing to a new line.

end

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

executed

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

float

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

floor

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

flowchart

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 function 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 cause the interpreter to load the contents of the random module into memory?

import random

Where does a computer store a program and the data that the program is working with while the program is running?

in main memory

A _____ variable is created inside a function.

local

The following is an example of an instruction written in which computer language? 10110000

machine language

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

math

When using the logical operator, one or both of the subexpressions must be true for the compound expression to be true.

or

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

parameter

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

scope

Programs are commonly referred to as

software

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

standard library

Which type of error prevents the program from running?

syntax

In Python, the variable in the for clause is referred to as the _____ because it is the target of an assignment at the beginning of each loop iteration.

target variable

In Python the _____ symbol is used as the equality operator.

==

A value-returning function is

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

In Python, math expressions are always evaluated from left to right, no matter what the operators are. (TRUE OR FALSE)

False

Python allows you to compare strings, but it is not case sensitive. (TRUE or FALSE)

False

Python uses the same symbols for the assignment operator as for the equality operator. (TRUE or FALSE)

False

Short -circuit evaluation is only performed with the not operator. (TRUE or FALSE)

False

To get the total number of iterations in a nested loop, add the number of iterations in the inner loop to the number in the outer loop. (TRUE or FALSE)

False

One of the drawbacks of a modularized program is that the only structure you can use in such a program is the sequence structure. (TRUE or FALSE)

Fasle

_____ is the process of inspecting data that has been input into a program in order to ensure that the data is valid before it is used in a computation.

Input Validation

What type of volatile memory is usually used only for temporary storage while running a program?

RAM

A value-returning function is like a simple function except that when it finishes it returns a value back to the part of the program that called it. (TRUE or FALSE)

True

An action in a single alternative decision structure is performed only when the condition is true. (TRUE or FALSE)

True

Decision structures are also known as selection structures. (TRUE or FALSE)

True

Different function can have local variables with the same names. (TRUE or FALSE)

True

In Python you can have a list of variables on the left side of the argument operator. (TRUE or FALSE)

True

In Python, print statements written on separate lines do not necessarily output on separate lines. (TRUE or FALSE)

True

In a flowchart, both the decision structure and the repetition structure use the diamond symbol to represent the condition that is tested. (TRUE or FALSE)

True

In a nested loop, the inner loop goes through all of its iterations for every iteration of the outer loop. (TRUE or FALSE)

True

One reason not to use global variables is that it makes a program hard to debug. (TRUE or FALSE)

True

One reason to store graphics functions in a module is so that you can import the module into any program that needs to use those functions. (TRUE or FALSE)

True

Python allows you to pass multiple arguments to a function. (TRUE or FALSE)

True

Python function names follow the same rules as those for naming variables. (TRUE or FALSE)

True

RAM is a volatile memory used for temporary storage while a program is running. (TRUE OR FALSE)

True

The CPU understands instructions written in a binary machine language. (TRUE OR FALSE)

True

The function header marks the beginning of the function definition. (TRUE or FALSE)

True

The if statement causes one or more statements to execute only when a Boolean expression is true. (TRUE or FALSE)

True

The randrange function returns a randomly selected value from a specific sequence of numbers. (TRUE or FALSE)

True

The value assigned to a global constant can be changed in the mainline logic. (TRUE or FALSE)

True

To assign a value to a global variable in a function, the global variable must be first declared in the function. (TRUE or FALSE)

True

A Boolean variable can reference one of two values which are

True or False

The variable used to keep the running total

accumulator

What is the correct if clause to determine whether the choice is anything other than 10?

if choice != 10

Which of the following is the correct if clause to determine whether y is in the range 10 - 50, inclusive?

if y >= 10 and y <= 50:

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

interpreter

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

list

Which logical operators perform short-circuit evaluation?

or and

The first operation is called the _____ and its purpose is to get the first input value that will be tested by the validation loop.

priming read

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

quote marks

A(n) _____ structure is a structure that causes a statement or a set of statements to execute repeatedly.

repetition

A _____ has no moving parts and operates faster than a traditional disk.

solid state drive

Which of the following is not a major component of a typical computer system?

the operating system

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

top-down

The encoding technique used to store negative numbers in the computer's memory is called

two's complement

What does the following expression mean? x<=y

x is less than or equal to y


Kaugnay na mga set ng pag-aaral

NURS 6700 Module 1 - Chapter 5 + 8

View Set

Maternal/Newborn ATI Practice Tests

View Set

Management 340 Organizational behavior

View Set

Chapter 3: Managing External Relations

View Set