You are on page 1of 15



python flashcards | Quizlet

184 terms by quizlette7035835

Like this study set? Create a free account to save it.

Create a free account


A set of specific steps for solving a
category of problems


an error in a program


in a program that is meant for other
programmers (or anyone reading the
source code) and has no effect on the
execution of the program


basic elements of a language(letters,
numbers, symbols)

high-level language

A programming language like Python that
is designed to be easy for humans to read
and write.

low-level langauge

A programming language that is designed
to be easy for a computer to execute; also
called machine language or assembly


A function used in a program or script that
causes the Python interpreter to display a
value on its output device.

runtime error

An error that does not occur until the
program has started to execute but that
prevents the program from continuing.­flash­cards/


works on integers (and integer expressions) and gives the remainder when the first number is divided by the second evaluate To simplify an expression by performing the operations in order to yield a single value. string contains a string of letters variable name that refers to a value assignment statement gives value to a variable keyword define the language's syntax rules and­flash­cards/ 2/15 . int A Python data type that holds positive and negative whole numbers float A Python data type which stores floatingpoint numbers. https://quizlet. multiplication and division modulus operator %.6/28/2016 python flashcards | Quizlet semantic error An error in a program that makes it do something other than what the programmer intended. they look like decimal numbers flow of execution The order in which statements are executed during a program run. When printed in the standard format. Floating-point numbers are stored internally in two parts: a base and an exponent. semantic the meaning of a program syntax The structure of a program syntax error An error in a program that makes it impossible to parse — and therefore impossible to interpret. and they cannot be used as variable names statement instruction that the Python interpreter can execute operators special tokens that represent computations like addition.

None A special Python value. Definite iteration is usually best coded as a for loop https://quizlet. such as a conditional statement inside a branch of another conditional statement type conversion An explicit function call that takes a value of one type and computes a corresponding value of another type. parameter A name used inside a function to refer to the value which was passed to it as an argument. definite iteration A loop where we have an upper bound on the number of times the body will be executed.6/28/2016 python flashcards | Quizlet function A named sequence of statements that performs some useful operation. conditional statement A statement that controls the flow of execution depending on some­flash­cards/ 3/15 . boolean expression An expression that is either true or false. One use in Python is that it is returned by functions that do not execute a return statement with a return argument. elif. The only possible values of the bool type are False and True. boolean function A function that returns a Boolean value. conditional statement One program structure within another. Functions may or may not take parameters and may or may not produce a result fruitful function A function that returns a value when it is called. A local variable can only be used inside its function. Parameters of a function are also a special kind of local variable. and else are used for conditional statements. block A group of consecutive statements with the same indentation. In Python the keywords if. local variable A variable defined inside a function.

https://quizlet. trace To follow the flow of execution of a program by hand. nested loop A loop inside the body of another loop. Copying a reference to an object creates an alias but doesn't clone the object. recording the change of state of the variables and any output produced.6/28/2016 python flashcards | Quizlet increment Both as a noun and as a verb. mutable type A compound data type whose elements can be assigned new values. file A named entity. even inside of functions. aliases Multiple variables that contain references to the same object. increment means to increase by 1. decrement To subtract one from a variable. compound data type A data type that is itself made up of elements that are themselves values. iteration Repeated execution of a set of programming­flash­cards/ 4/15 . format operator The % operator takes a format string and a tuple of values and generates a string by inserting the data values into the format string at the appropriate locations. clone To create a new object that has the same value as an existing object. immutable type A compound data type whose elements can NOT be assigned new values. usually stored on a hard drive. iteration To repeat a section of code. floppy disk. or CD-ROM. that contains a stream of characters. dictionary A collection of key/value pairs that maps from keys to values. exception Raised by the runtime system if something goes wrong while the program is running. global variable Can be seen through a program module.

6/28/2016 python flashcards | Quizlet nested list A list that is itself contained within a list. This value is assigned to the corresponding parameter in the function. multiplication. integer division An operation that divides one integer by another and yields an integer. str converts to a string traverse To repeat an operation on all members of a set from the start to the end. argument a value provided to a function when the function is called. robot mechanism or an artificial entity that can be guided by automatic controls. Integer division yields only the whole number of times that the numerator is divisible by the denominator and discards any remainder. pixel Smallest addressable element of a­flash­cards/ 5/15 . On a human. recursion The process of calling the currently executing function. slice A copy of part of a sequence specified by a series of indices. stopping when it is no longer necessary to evaluate any further to determine the final outcome. sequence A data type that is made up of elements organized linearly. operator A special symbol that represents a simple computation like addition. https://quizlet. short circuit evaluation When a boolean expression is evaluated the evaluation starts at the left hand expression and proceeds to the right. proprioception on a robot. internal sensing mechanisms. a sense of the relative positions of different parts of ones own body. or string concatenation. with each element accessed by an integer index.

the correction has to be made many times.6/28/2016 python flashcards | Quizlet element One of the values in a list (or other sequence). 8 What are the values that the variable num contains through the iterations of the following for loop? for num in range(4) 0. 3 The variable used to keep the running total Accumulator What is not an example of an augmented assignment operator <= _____ 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. The bracket operator selects elements of a list. (It is also a keyword used to create such an anonymous function. 6.) module A file containing definitions and statements intended to be imported by other­flash­cards/ 6/15 . What type of loop structure repeats the code a specific number of times Count-controlled loop What type of loop structure repeats the code based on the value of the Boolean expression Condition-controlled loop What is the format for the while clause in Python while condition : statement What are the values that the variable num contains through the iterations of the following for loop? for num in range(2. 2) 2. 1. 2. 4. Input validation https://quizlet. 9. What is the disadvantage of coding in one long sequence structure? If parts of the duplicated code have to be corrected. lambda A piece of code which can be executed as if it were a function but without a name.

an infinite loop usually occurs when the computer accesses the wrong memory address. 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.6/28/2016 python flashcards | Quizlet The first input operation is called the _____. a comma-separated sequence of data items that are enclosed in a set of brackets is called a _____. and its purpose is to get the first input value that will be tested by the validation loop. Target Variable Which of the following represents an example to calculate the sum of the numbers (accumulator)? total += number True/False: A better 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 the statements as many times as necessary. True True/False: In flowcharting.5): False https://quizlet. list In Python. False True/False: Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(­flash­cards/ 7/15 . the decision structure and the repetition structure both use the diamond symbol to represent the condition that is tested. True True/False: The first line in the while loop is referred to as the condition clause. Priming read What is the structure that causes a statement or a set of statements to execute repeatedly? Repetition When will the following loop terminate? while keep_on_going != 999 : When keep_on_going refers to a value not equal to 999 In Python. True True/False: In Python.

Pretest In Python. Condition The while loop is known as a(n) ?? loop because it tests conditions before performing an iteration.6/28/2016 python flashcards | Quizlet True/False: The integrity of a program's output is only as good as the integrity of its input. True True/False: To get the total number of iterations of a nested loop. multiply the number of iterations of all the loops. Running A(n) ?? is a special value that marks the end of a sequence of­flash­cards/ 8/15 . Input The ?? function is a built-in function that generates a list of integer values. GIGO A(n) ?? validation loop is sometimes called an error trap or an error handler. the inner loop goes through all of its iterations for every single iteration of an outer loop. Sentinel The acronym ?? refers to the fact that the computer cannot tell the difference between good data and bad data. True True/False: In a nested loop. For this reason the program should discard input that is invalid and prompt the user to enter correct data. Range Programs are commonly referred to as software Which of the following is considered to be the world's first programmable electronic computer ENIAC https://quizlet. For A(n) ?? total is a sum of numbers that accumulates with each iteration of a loop. you would use the ?? statement to write a count-controlled loop. Repetition A(n) ??-controlled loop causes a statement or set of statements to repeat as long as a condition is true. True A(n) ?? structure causes a statement or set of statements to execute repeatedly.

create. and test computer programs. and operates faster than a traditional disk drive. magnetically A _____ has no moving­flash­cards/ 9/15 .6/28/2016 python flashcards | Quizlet Where does a computer store a program and the data that the program is working with while the program is running? Main memory What type of volatile memory is usually used only for temporary storage while running a program? RAM Which of the following is not a microprocessor manufacturing company? Dell Which computer language uses short words known as mnemonics for writing programs? Assembly The process known as the _____ cycle is used by the CPU to execute instructions in a program. solid state drive True/False: A software developer is the person with the training to design. fetch-decode-execute The following is an example of an instruction written in which computer language? 10110000 Machine language What is the encoding technique called that is used to store negative numbers in the computer's memory? two's complement The _____ coding scheme contains a set of 128 numeric codes that are used to represent characters in the computer memory. ASCII What is the largest value that can be stored in one byte? 255 The smallest storage location in a computer's memory bit The disk drive is a secondary storage device that stores data by _____ encoding it onto a spinning circular disk. True https://quizlet.

False True/False: The instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand. even when the power supply to the computer is turned off. True True/False: RAM is a volatile memory used for temporary storage while a program is running. program The term _______________ refers to all of the physical devices that a computer is made of. False True/False: The CPU is able to quickly access data stored at any random location in ROM. False A(n) _______________ is a set of instructions that a computer follows to perform a task. True True/False: The CPU understands instructions written in a binary machine language. cpu _______________ are small central processing unit chips. micro processors https://quizlet.6/28/2016 python flashcards | Quizlet True/False: A computer is a single device that performs different types of tasks for its­flash­cards/ 10/15 . True True/False: The Python language uses a compiler. True True/False: The main reason for using secondary storage is to hold data for long periods of time. False True/False: All programs are normally stored in ROM and loaded into RAM as needed for processing. which is a program that both translates and executes the instructions in a high level language. hardware The _______________ is the part of a computer that actually runs programs and is the most important component in a computer.

magnetically The Python _______________ is a program that can read Python programming statements and execute them. end https://quizlet.6/28/2016 python flashcards | Quizlet Main memory is commonly known as­flash­cards/ 11/15 . 3 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 The _____ function reads a piece of data that has been entered at the keyboard and returns that piece of data. RAM _______________ is a type of memory that can hold data for long periods of time. interpreter In _______________ mode. you can set the _____ argument to a space or empty string to stop the output from advancing to a new line. as a string. the interpreter reads the contents of a file that contains Python statements and executes each statement. script What type of error produces incorrect results but does not prevent the program from running? logic The program development cycle is made up of _____ steps that are repeated until no errors can be found in the program. input The line continuation character is a _____. \ Which mathematical operator is used to raise five to the second power in Python? ** In a print statement. secondary storage A disk drive stores data by _______________ encoding it onto a circular disk. even when there is no power to the computer. back to the program.

print statements written on separate lines do not necessarily output on separate­flash­cards/ 12/15 .6/28/2016 python flashcards | Quizlet After the execution of the following statement.549) 68 The output of the following print statement is: print 'I\'m ready to begin' I'm ready to begin If value1 is 2. the variable price will reference the value _____. some process is performed on the input. True https://quizlet.0 and value2 is 12.752 float After the execution of the following statement. price = int(68. True True/False: Python formats all floatingpoint numbers to two decimal places when outputting using the print statement. when an integer is divided by an integer. False True/False: Python allows programmers to break a statement into multiple lines. the variable sold will reference the numeric literal value as a(n) _____ data type: sold = 256. False True/False: Computer programs typically perform three steps: Input is received. input() What is the output of the following print statement? print('The path is D:\\sample\\test. and output is produced.') The path is D:\sample\test What symbol is used to mark the beginning and end of a string? Quotation True/False: According to the behavior of integer division. what is the output of the following command? print(value1 * value2) 24. True True/False: In Python.0 The _____ built-in function is used to read a number that has been typed on the keyboard. the result will be a float.

formatting When applying the . the result is _______________. one or both subexpressions must be true for the compound expression to be true. modulus A(n) _______________ character is a special character that is preceded with a backslash. double alternative Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions. 76. comments The % symbol is the remainder operator and it is also known as the _______________ operator.159 A(n) _______________ is a name that represents a value stored in the computer's memory. it performs string _______________.6/28/2016 python flashcards | Quizlet True/False: The \t escape character causes the output to skip over to the next horizontal tab.3f formatting specifier to the following number. True _______________ are notes of explanation that document lines or sections of a program. Or https://quizlet. appearing inside a string literal. Concatenation A(n) _____ structure is a logical design that controls the order in which a set of statements­flash­cards/ 13/15 . control The decision structure that has two possible paths of execution is known as _____. escape The _______________ specifier is a special set of characters that specify how a value should be formatted. data types When the + operator is used with two strings. compound When using the _____ operator. variable Python uses _______________ to categorize values in memory. 76.15854.

False True/False: Python allows you to compare strings. False True/False: Short-circuit evaluation is performed with the not operator. True True/False: An action in a single alternative decision structure is performed only when the condition is true. False True/False: Nested decision structures are one way to test more than one condition. the _______________ symbol is used to represent a Boolean expression. but it is not case sensitive. true or false True/False: The Python language is not sensitive to block structuring of code. True The _______________ statement is used to create a decision structure. and True/False: The if statement causes one or more statements to execute only when a Boolean expression is true. True True/False: The not operator is a unitary operator and it must be a compound expression. If In flowcharting. single alternative In a decision structure. True True/False: Decision structures are also known as selection structures. diamond A(n) _______________ decision structure provides only one alternative path of execution. True Boolean variable can reference one of two values: _____. False True/False: Expressions that are tested by the if statement are called Boolean expressions.6/28/2016 python flashcards | Quizlet Which logical operators perform shortcircuit evaluation?­flash­cards/ 14/15 . the action is _______________ executed because it is performed only when a certain condition is true. conditionally https://quizlet.

com/102225170/python­flash­cards/ 15/15 .6/28/2016 python flashcards | Quizlet A(n) _______________ operator determines whether a specific relationship exists between two values. which makes the logic of the nested decision structure simpler to write if elif else The logical _______________ operator reverses the truth of a Boolean expression. compound https://quizlet. flags A(n) _______________ expression is made up of two or more Boolean expressions. not Boolean variables are commonly used as _______________ to indicate whether a specific condition exists. relational A(n) _______________ statement will execute one block of statements if its condition is true. if/else Python provides a special version of a decision structure known as the _______________ statement. or another block if its condition is false.