Python Test 1 Practice

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

This is a volatile type of memory that is used only for temporary storage while a program is running. 1. RAM 2. secondary storage 3. the disk drive 4. the USB drive

RAM

A magic number is . 1. a number that is mathematically undefined 2. an unexplained value that appears in a program's code 3. a number that cannot be divided by 1 4. a number that causes computers to crash

a number that is mathematically undefined

If you were to look at a machine language program, you would see __________. a. Python code b. a stream of binary numbers c. English words d. circuits

a stream of binary numbers

A(n) ________ variable keeps a running total. 1. sentinel 2. sum 3. total 4. accumulator

accumulator

A(n) ___ is a set of well-defined logical steps that must be taken to perform a task. a. logarithm b. plan of action c. logic schedule d. algorithm

algorithm

A compound Boolean expression created with the ______ operator is true only if both of its subexpressions are true. 1. and 2. or 3. not 4. both

and

The __________ translates an assembly language program to a machine language program. a. assembler b. compiler c. translator d. interpreter

assembler

A(n) _______ makes a variable reference a value in the computer's memory. 1. variable declaration 2. assignment statement 3. math expression 4. string literal

assignment statement

The -= operator is an example of a(n) ______ operator. 1. relational 2. augmented assignment 3. complex assignment 4. reverse assignment

augmented assignment

In a(n) __________ numbering system, all numeric values are written as sequences of 0s and 1s. a. hexadecimal b. binary c. octal d. decimal

binary

A byte is made up of eight __________ . a. CPUs b. instructions c. variables d. bits

bits

A __________ is enough memory to store a letter of the alphabet or a small number. a. byte b. bit c. switch d. transistor

byte

Short notes placed in different parts of a program explaining how those parts of the program work are called ________ . 1. comments 2. reference manuals 3. tutorials 4. external documentation

comments

A(n) __________ program translates a high-level language program into a separate machine language program. a. assembler b. compiler c. translator d. utility

compiler

A _________-controlled loop uses a true/false condition to control the number of times that it repeats. 1. Boolean 2. condition 3. decision 4. count

condition-controlled

A _______-controlled loop repeats a specific number of times. 1. Boolean 2. condition 3. decision 4. count

count-controlled

A ________ structure can execute a set of statements only under certain circumstances. 1. sequence 2. circumstantial 3. decision 4. Boolean

decision

In the __________ part of the fetch-decode-execute cycle, the CPU determines which operation it should perform. a. fetch b. decode c. execute d. immediately after the instruction is executed

decode

A _____ is any hypothetical person using a program and providing input for it. 1. designer 2. user 3. guinea pig 4. test subject

designer

A(n) _______ structure tests a condition and then takes one path if the condition is true, or another path if the condition is false 1. if statement 2. single alternative decision 3. dual alternative decision 4. sequence

dual alternative decision

A string literal in Python must be enclosed in . 1. parentheses. 2. single-quotes. 3. double-quotes. 4. either single-quotes or double-quotes.

either single-quotes or double-quotes

Validation loops are also known as ________ 1. error traps 2. doomsday loops 3. error avoidance loops 4. defensive loops

error traps

A _______ is a Boolean variable that signals when some condition exists in the program. 1. flag 2. signal 3. sentinel 4. siren

flag

Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of which data type? 1. int 2. float 3. currency 4. str

float

Which built-in function can be used to convert an int value to a float? 1. int_to_float() 2. float() 3. convert() 4. int()

float()

Real numbers are encoded using the __________ technique. a. two's complement b. floating point c. ASCII d. Unicode

floating point

A _________ is diagram that graphically depicts the steps that take place in a program. a. flowchart b. step chart c. code graph d. program graph

flowchart

GIGO stands for ______ 1. great input, great output 2. garbage in, garbage out 3. GIGahertz Output 4. GIGabyte Operation

garbage in, garbage out

The physical devices that a computer is made of are referred to as . 1. hardware 2. software 3. the operating system 4. tools

hardware

You use a(n) statement to write a single alternative decision structure. 1. test-jump 2. if 3. if-else 4. if-call

if

You use a(n) _______ statement to write a dual alternative decision structure. 1. test-jump 2. if 3. if-else 4. if-call

if-else

A(n) ______ loop has no way of ending and repeats until the program is interrupted. 1. indeterminate 2. interminable 3. infinite 4. timeless

infinite

The integrity of a program's output is only as good as the integrity of the program's ________ 1. compiler 2. programming language 3. input 4. debugger

input

A component that collects data from people or other devices and sends it to the computer is called . 1. an output device 2. an input device 3. a secondary storage device 4. main memory

input device

Which built-in function can be used to read input that has been typed on the keyboard? 1. input() 2. get_input() 3. read_input() 4. keyboard()

input()

Each repetition of a loop is known as a(n) . 1. cycle 2. revolution 3. orbit 4. iteration

iteration

The words that make up a high-level programming language are called __________. a. binary instructions b. mnemonics c. commands c. key words

key words

A ________ error does not prevent the program from running, but causes it to produce incorrect results. a. syntax b. hardware c. logic d. fatal

logic

The symbols >, <, and == are all operators. 1. relational 2. logical 3. conditional 4. ternary

logical

and, or, and not are ______ operators. 1. relational 2. logical 3. conditional 4. ternary

logical

Computers can only execute programs that are written in __________. a. Java b. assembly language c. machine language d. Python

machine language

The computer stores a program while the program is running, as well as the data that the program is working with, in __________. a. secondary storage b. the CPU c. main memory d. the microprocessor

main memory

Today, CPUs are small chips known as __________. a. ENIACs b. microprocessors c. memory chips d. operating systems

microprocessors

A ______ is a name that represents a value that does not change during the program's execution. 1. named literal 2. named constant 3. variable signature 4. key term

named constant

The ______ operator takes a Boolean expression as its operand and reverses its logical value. 1. and 2. or 3. not 4. either

not

In the expression 12 + 7, the values on the right and left of the + symbol are called _______ . 1. operands 2. operators 3. arguments 4. math expressions

operands

A compound Boolean expression created with the _______ operator is true if either of its subexpressions is true. 1. and 2. or 3. not 4. either

or

A video display is a(n) ______ device. 1. output 2. input 3. secondary storage 4. main memory

ouput

The tiny dots of color that digital images are composed of are called __________. a. bits b. bytes c. color packets d. pixels

pixels

The while loop is a _____ type of loop. 1. pretest 2. no-test 3. prequalified 4. post-iterative

pretest

The input operation that appears just before a validation loop is known as the _______. 1. prevalidation read 2. primordial read 3. initialization read 4. priming read

priming read

A(n) __________ is a set of instructions that a computer follows to perform a task. 1. compiler 2. program 3. interpreter 4. programming language

program

An informational language that has no syntax rules and is not meant to be compiled or executed is called _______. a. faux code b. pseudocode c. C# d. a flowchart

pseudocode

A type of memory that can hold data for long periods of time, even when there is no power to the computer, is called __________ . a. RAM b. main memory c. secondary storage d. CPU storage

secondary storage devices

A(n) _______ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list. 1. sentinel 2. flag 3. signal 4. accumulator

sentinel

A _______ structure provides one alternative path of execution

single alternative decision

A _____ is a sequence of characters. 1. char sequence 2. character collection 3. string 4. text block

string

The rules that must be followed when writing a program are called __________. a. syntax b. punctuation c. key words d. operators

syntax

The part of a computer that runs programs is called . 1. RAM 2. secondary storage 3. main memory 4. the CPU

the CPU

Negative numbers are encoded using the __________ technique. a. twos compliment b. floating point c. ASCII d. Unicode

twos compliment

An extensive encoding scheme that can represent characters for many languages in the world is __________. a. binary numbering b. ASCII c. Unicode d. ENIAC

unicode

A _____ is a name that references a value in the computer's memory. 1. variable 2. register 3. RAM slot 4. byte

variable

A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is __________. a. binary numbering b. ASCII c. Unicode d. ENIAC

ASCII

A(n) _______ expression has a value of either True or False. 1. binary 2. decision 3. unconditional 4. Boolean

Boolean

Which of the following statements will cause an error? 1. x = 17 2. 17 = x 3. x = 99999 4. x = '17'

17 = x

This symbol marks the beginning of a comment in Python. 1. & 2. * 3. ** 4. #

#

This operator performs division, but instead of returning the quotient it returns the remainder. 1. % 2. * 3. ** 4. /

%

This is an operator that raises a number to a power. 1. % 2. * 3. ** 4. /

**

This operator performs integer division. 1. // 2. % 3. ** 4. /

//

A bit that is turned off represents the following value: __________ . a. 1 b. -1 c. 0 d. "no"

0


Kaugnay na mga set ng pag-aaral

2.4 assessment types / special considerations

View Set

Unit 4 Guide- Chapter 8 (Physio honors)- STUDY QUESTIONS

View Set