







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
A comprehensive set of python computer science exam questions with correct answers, covering fundamental concepts like programming, hardware, memory, input/output devices, data representation, programming languages, algorithms, data structures, and file handling. It's a valuable resource for students preparing for exams or seeking to reinforce their understanding of python programming.
Typology: Exams
1 / 13
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 - Answer Program The physical devices that a computer is made of are referred to as ______ - Answer Hardware *The part of a program that runs the programs is called the ____ - Answer CPU Today, CPU's are small chips known as _______ - Answer Microprocessors The computer stores a program while the program is running, as well as the data that the program is working with, in ____ - Answer Main memory *_____ is a volatile type of memory that is used only for temporary storage while a program is running - 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 _______ - Answer Secondary Storage A component that collects data from people or other devices and sends it to the computer is called ______ - Answer an input device A video display is an _______ device - Answer Output
A ____ is enough memory to store a letter of the alphabet or a small number - Answer byte *A byte is made up of 9 ____ - Answer bits *Numeric values are written in a sequence of 1's and 0's in the ____ numbering system - Answer binary *A bit that is turned off represents the value of ____ - Answer 0 *A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is _____ - Answer ASCII *An extensive encoding system scheme that can represent characters for many languages in the world is ___ - Answer Unicode Negative numbers are encoded using the ______ technique - Answer Two's Complement Real numbers are encoded using the _____ technique - Answer Floating Point *The tiny dots of color that digital images are composed of are ________ - Answer Pixels If you were to look at a machine language program, you would see __________ - Answer a stream of binary numbers
*A _____ is a diagram that graphically depicts the steps that take place in a program - Answer Flowchart *A ______ is a sequence of characters - Answer String *A ______ is a name that references a value in the computers memory - Answer Variable A _____ is a hypothetical person using a program and providing input for it - Answer User A string literal is Python must be enclosed in __ - Answer single or double quotes Short notes placed in different part of a program explaining how those parts of the program work are called _______ - Answer Comments (#) (12, 7) The values are called ______ - Answer Operands *This operator performs integer division - Answer // *This operator raises a number to a power - Answer ** *This operator performs division but returns the remainer - Answer % *This built in function can be used to read input that has been typed on the keyboard - Answer input()
A ______ structure can execute a set of statements only under certain circumstances - Answer Decision *A ________ expression has a value to either true or false - Answer Boolean *The symbols >,<, and == are all ________ operators - Answer Relational *A _______ structure tests a condition and then takes one path if the condition is true, or another path if the condition is false - Answer Dual alternative decision *You use an _____ statement to write a single alternative decision structure - Answer If *You use an _____ statement to write a dual decision structure - Answer If-else *And, or, and not are ______ operators - Answer Logical *A compound Boolean structure created with the ____ operator is true only if both of its sub-expressions are trye - Answer And *A compound Boolean structure created with the ___ operator is true either of its sub-expressions is true - Answer Or The ________ operator takes a Boolean expression as its operand and reverses its logical value - Answer Not (!=)
*A design technique that helps to reduce the duplication of code within a program and is a benefit of using functions is ______ - Answer Code reuse The first line of a function definition is known as the ____ - Answer Header *You ______ a function to execute it - Answer Call A design technique that programmers use to break down an algorithm into functions is known as ______ - Answer Top-down design A ______ is a diagram that gives visual representation of the relationships between functions - Answer hierarchy chart *A ________ is a variable that is created inside a function - Answer local A _____ is the part of a program in which a variable may be accessed - Answer Scope **A_____ is a piece of data that is sent into a function - Answer Argument **A _____ is a special variable that receives a piece of data when a function is called - Answer Parameter *A variable that is visible to every function in a program file is _______ - Answer Global variable
*This is a prewritten function that is built into a programming language - Answer Library *This statement causes a function to end and sends a value back to the part of the program that called the function - Answer Return *An _____ chart is a design tool that describes the input, processing, and output of a function - Answer IPO *You must have an _____ statement in your program in order to use the functions in the math module - Answer Import The data that is written to is known as an _____ - Answer Output file Before a file can be used by a program, it must be _____ - Answer Opened This type of file contains data that has not been converted to text - 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 - 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 - Answer Direct Access This is a small "holding section" in a memory that many systems write data to before writing data to a file - Answer Buffer
When the * operator's left operand is a list and its right operand is an integer, the operator becomes this - Answer The repetition operator *This method adds an item to the end of an existing list - Answer Append *This removes an item at a specific index in a list/ deletes an element from a dictionary, set - Answer Del statement If you call the index method to locate an item in a list and the item is not found, this happens - Answer A ValueError exception is raised *This built in function returns the highest value in a list - Answer max *This string method returns a copy of the string with all leading whitespace characters removed - Answer lstrip *This string method returns the lowest index in the string where a specified substring is found - Answer Find *This operator determines where one string is contained inside another string - Answer In *This string method returns true if a string contains only alphabetical characters and is at least one character in length - Answer isalpha() *This method returns true if a string contains only numeric digits and is at least one character in length - Answer isdigit()
This string returns a copy of the string with all leading and trailing whitespace characters removed - Answer strip *You can use ___ operator to determine whether a key exists in a dictionary - Answer In *________ method returns a randomly selected key-value pair from the dictionary
In ones approach to identifying a class's data attributes and methods, the programmer identifies the class's _________ - Answer Responsibilites