




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
PYTHON COMPUTER SCIENCE EXAM WITH SOLUTIONS #6
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





*A ____ is a set of instructions that a computer follows to perform a task - correct answer Program The physical devices that a computer is made of are referred to as ______ - correct answer Hardware *The part of a program that runs the programs is called the ____ - correct answer CPU Today, CPU's are small chips known as _______ - correct answer Microprocessors The computer stores a program while the program is running, as well as the data that the program is working with, in ____ - correct answer Main memory *_____ is a volatile type of memory that is used only for temporary storage while a program is running - correct answer RAM A type of memory that can hold data for long periods of time, even when there is no power to the computer is called _______ - correct answer Secondary Storage A component that collects data from people or other devices and sends it to the computer is called ______ - correct answer an input device A video display is an _______ device - correct answer Output A ____ is enough memory to store a letter of the alphabet or a small number - correct answer byte *A byte is made up of 9 ____ - correct answer bits *Numeric values are written in a sequence of 1's and 0's in the ____ numbering system
Real numbers are encoded using the _____ technique - correct answer Floating Point *The tiny dots of color that digital images are composed of are ________ - correct answer Pixels If you were to look at a machine language program, you would see __________ - correct answer a stream of binary numbers In the ______ part of the fetch_decode-execute cycle, the CPU determines which operation it should perform - correct answer Decode Computers only execute programs that are written in _________ - correct answer Machine language *The ________ translates an assembly language program to a machine language program - correct answer Assembler *The words that make up a high-level programming language are called _______ - correct answer Key Words *The rules that must be followed when writing a program are called ______ - correct answer Syntax *A _______ program translates a high-level language program into a machine language program - correct answer Compiler *A ___ error does not prevent the program from running, but causes it to produce incorrect results - correct answer Logic A _____ is a single function that the program must perform in order to satisfy the customer - correct answer Software Requirement *A ______ is a set of well defined logical steps that must be taken to perform a task - correct answer Algorithm An informal language that has no syntax rules and is not meant to be compiled or executed is called _______ - correct answer Psuedocode *A _____ is a diagram that graphically depicts the steps that take place in a program - correct answer Flowchart *A ______ is a sequence of characters - correct answer String
The ________ operator takes a Boolean expression as its operand and reverses its logical value - correct answer Not (!=) *In Python, _____ determines which lines of code are included in a block - correct answer indent *A ________ controlled loop uses a T/F condition to control the number of times that it repeats - correct answer Condition *A _______ controlled loop repeats a specific number of times - correct answer Count Each repetition loop is known as an ______ - correct answer iteration The while loop is a _____ type of loop - correct answer pretest *An _______ loop has no way of ending and repeats until the program is interrupted - correct answer infinite *An _______ variable keeps a running total - correct answer Accumulator *A ______ is a special value that signals when there are no more items to be processed
*A ________ is a variable that is created inside a function - correct answer local A _____ is the part of a program in which a variable may be accessed - correct answer Scope **A_____ is a piece of data that is sent into a function - correct answer Argument **A _____ is a special variable that receives a piece of data when a function is called - correct answer Parameter *A variable that is visible to every function in a program file is _______ - correct answer Global variable *This is a prewritten function that is built into a programming language - correct answer Library *This statement causes a function to end and sends a value back to the part of the program that called the function - correct answer Return *An _____ chart is a design tool that describes the input, processing, and output of a function - correct answer IPO *You must have an _____ statement in your program in order to use the functions in the math module - correct answer Import The data that is written to is known as an _____ - correct answer Output file Before a file can be used by a program, it must be _____ - correct answer Opened This type of file contains data that has not been converted to text - correct answer Binary When working with this type of file, you access its data from the beginning of the file to the end of the file - correct answer Sequential Acces When working with this type of file, you can jump directly to any piece of data in the file without reading the data that comes before it - correct answer Direct Access This is a small "holding section" in a memory that many systems write data to before writing data to a file - correct answer Buffer This marks the location of the next item that will be read from a file - correct answer Read position
*This operator determines where one string is contained inside another string - correct answer In *This string method returns true if a string contains only alphabetical characters and is at least one character in length - correct answer isalpha() *This method returns true if a string contains only numeric digits and is at least one character in length - correct answer isdigit() This string returns a copy of the string with all leading and trailing whitespace characters removed - correct answer strip *You can use ___ operator to determine whether a key exists in a dictionary - correct answer In *________ method returns a randomly selected key-value pair from the dictionary - correct answer popitem() *________ method returns the value associated with a specified key and removes that key-value pair from the dictionary - correct answer pop() *______ dictionary method returns the value associated with a specified key - correct answer get() ______ method returns all of dictionary's keys and their associated values as a sequence of tuples - correct answer items() Can add an element to a set with this method - correct answer add *You can add a group of elements to a set with a mehtod - correct answer Update *This set method removes an element but does not raise an exception if the element isnt found - correct answer Discard *The ____ set method removes an element and raises an exception if the element isnt found - correct answer Remove *The _____ list method returns the number of times a specific value occurs in a list - correct answer count The_____ programming practice is centered on creating functions that are separate from the data that they work on - correct answer Procedural The ___ programming practice is centered on creating objects - correct answer object- oriented
A _____ is a component of a class that references data - correct answer data attribution An object is an _____ - correct answer Instance An ________ method gets the value of a data attribute but does not change it - correct answer accessor A ______ method stores a value in a data attribute or changes its value in some other way - correct answer mutator The ____ method is automatically called when an object is created - correct answer init_ A set of standard diagrams for graphically depicting object-oriented systems is provided by ____ - correct answer a UML In one approach to identifying the classes in a problem, the programmer identifies the _____ in a description of the problem domain - correct answer nouns In ones approach to identifying a class's data attributes and methods, the programmer identifies the class's _________ - correct answer Responsibilites