أنظمة مدمجة
This operator can be used to find the symmetric difference of two sets.
A. |
B. &
C. -
D. ˆ
This operator can be used to find the intersection of two sets.
A. |
B. &
C. -
D. ˆ
This operator can be used to find the difference of two sets.
A. |
B. &
C. -
D. ˆ
This operator can be used to find the union of two sets.
A. |
B. &
C. -
D. ˆ
This set method removes an element and raises an exception if the element is not found.
Remove
Discard
Delete
Erase
This set method removes an element, but does not raise an exception if the element is not found.
Remove
Discard
Delete
Erase
You can add a group of elements to a set with this method.
A. append
B. add
C. update
D. merge
You can add one element to a set with this method.
A. append
B. add
C. update
D. merge
The following function returns the number of elements in a set:
A. size( )
B. len( )
C. elements( )
D. count( )
The _________ method returns all of a dictionary’s keys and their associated values as a sequence of tuples
A. keys_values( )
B. items( )
C. values( )
D. get( )
The _________ dictionary method returns the value associated with a specified key. If the key is not found, it returns a default value.
A. pop( )
B. key( )
C. value( )
D. get( )
The _________ method returns the value associated with a specified key and removes that key-value pair from the dictionary.
A. pop( )
B. random( )
C. popitem( )
D. rand_pop( )
The _________ method returns a randomly selected key-value pair from a dictionary.
A. pop( )
B. random( )
C. popitem( )
D. rand_pop( )
You can use _________ to create an empty dictionary.
A. {}
B. ()
C. []
D. empty()
The _________ function returns the number of elements in a dictionary:
A. size( )
B. len( )
C. elements( )
D. count( )
You use _________ to delete an element from a dictionary.
A. The remove method
B. The erase method
C. The delete method
D. The del statement
You can use the _________ operator to determine whether a key exists in a dictionary.
A. &
B. in
C. ˆ
D. ?
This string method returns true if a string contains only numeric digits and is at least one character in length.
A. The digit method
B. The isdigit method
C. The numeric method
D. The isnumber method
This string method returns true if a string contains only alphabetic characters and is at least one character in length.
A. The isalpha method
B. The alpha method
C. The alphabetic method
D. The isletters method
This operator determines whether one string is contained inside another string.
Contains
Is_in
==
In
This function returns the length of a string.
Length
Size
Len
Lengthof
This will happen if you try to use an index that is out of range for a string
A. A ValueError exception will occur.
B. An IndexError exception will occur.
C. The string will be erased and the program will continue to run.
D. Nothing—the invalid index will be ignored.
This is the last index in a string.
�1
1
0
The size of the string minus one
This is the first index in a string.
�1
1
0
The size of the string minus one
Which of the following statements creates a tuple?
values = [1,2,3,4]
Values = {1,2,3,4}
Values = (1)
Values = (1,)
This file object method returns a list containing the file’s contents.
To_list
Getlist
Readline
Readlines
This built-in function returns the highest value in a list.
Highest
Max
Greatest
Best_of
If you call the index method to locate an item in a list and the item is not found, this happens.
A. A ValueError exception is raised.
B. An InvalidIndex exception is raised.
C. The method returns −1.
D. Nothing happens. The program continues running at the next statement.
Assume the following statement appears in a program: mylist][ =Which of the following statements would you use to add the string 'Labrador' to the list at index 0?
A. mylist[0] = 'Labrador'
B. mylist. insert(0, 'Labrador')
C. mylist. append('Labrador')
D. mylist. insert('Labrador', 0)
This removes an item at a specific index in a list.
A. The remove method
B. The delete method
C. The del statement
D. The kill method
This list method adds an item to the end of an existing list
A. add
B. add_to
C. increase
D. append
When the * operator’s left operand is a list and its right operand is an integer, the operator becomes this.
A. The multiplication operator
B. The repetition operator
C. The initialization operator
D. Nothing—the operator does not support those types of operands.
This function returns the length of a list.
A. length
B. size
C. len
D. lengthof
This will happen if you try to use an index that is out of range for a list.
A. A ValueError exception will occur.
B. An IndexError exception will occur.
C. The list will be erased and the program will continue to run.
D. Nothing—the invalid index will be ignored.
This is the last index in a list.
A. −1
B. 1
C. 0
D. The size of the list minus one
This is the first index in a list.
A. −1
B. 1
C. 0
D. The size of the list minus one
This is a number that identifies an item in a list.
A. element
B. index
C. bookmark
D. identifier
This term refers to an individual item in a list.
A. element
B. bin
C. cubbyhole
D. slot
This is a section of code that gracefully responds exceptions.
Exception generator
Exception manipulator
Exception handler
Exception monitor
When an exception is generated, it is said to have been
Built
Raised
Caught
Killed
This is a single piece of data within a record.
Field
Variable
Delimiter
Sub-record
When a file is opened in this mode, data will be written at the end of the file's existing contents.
Output mode
Append mode
Backup mode
Read-only mode
This marks the location of the next item that will be read from a file.
Input position
Delimiter
Pointer
Read position
This is a small "holding section" in memory that many systems write data to before writing the data to a file.
Buffer
Variable
Virtual file
Temporary file
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.
Ordered access
Binary access
Direct access
Sequential access
When working with this type of file, you access its data from the beginning of the file to the end of the file.
Ordered access
Binary access
Direct access
Sequential access
This type of file contains data that has not been converted to text.
Text file
Binary file
Unicode file
Symbolic file
The contents of this type of file can be viewed in an editor such as Notepad.
Text file
Binary file
English file
Human-readable file
When a program is finished using a file, it should do this.
Erase the file
Open the file
Close the file
Encrypt the file
Before a file can be used by a program, it must be
Formatted
Encrypted
Closed
Opened
A file that data is written to is known as a(n)
Input file
Output file
Sequential access file
Binary file
A file that data is read from is known as a(n)
Input file
Output file
Sequential access file
Binary file
A group of statements that exist within a program for the purpose of performing a specific task is a(n)
Block
Parameter
Function
Expression
A design technique that programmers use to reduce the duplication of code within a program and is a benefit of using functions as
Code reuse
Divide and conquer
Debugging
Facilitation of teamwork
The first line of a function definition is known as the
Body
Introduction
Initialization
Header
You __________ a function to execute it.
Define
Call
Import
Export
A design technique that programmers use to break down an algorithm into functions is known as
Top-down design
Code simplification
Code refactoring
Hierarchical subtasking
A __________ is a diagram that gives a visual representation of the relationships between functions in a program.
Top-down design
Flowchart
function relationship chart
Hierarchy chart
A __________ is a variable that is created inside a function.
Global variable
Local variable
hidden variable
none of the above; you cannot create a variable inside a function
A(n) __________ is the part of a program in which a variable may be accessed.
Mode
Declaration space
Area of visibility
Scope
A(n) __________ is a piece of data that is sent into a function.
Argument
Parameter
Header
Packet
A(n) __________ is a special variable that receives a piece of data when a function is called.
Argument
Parameter
Header
Packet
A variable that is visible to every function in a program file is a __________.
Local variable
Universal variable
Program-wide variable
Global variable
When possible, you should avoid using __________ variables in a program.
Local
Global
Reference
Parameter
This is a prewritten function that is built into a programming language.
Standard function
Library function
Custom function
Cafeteria function
This standard library function returns a random integer within a specified range of values.
Random
Randint
Random_integer
Uniform
This standard library function returns a random floating-point number in the range of 0.0 up to 1.0 (but not including 1.0).
Random
Randint
Random_integer
Uniform
This standard library function returns a random floating-point number within a specified range of values.
Random
Randint
Random_integer
Uniform
This statement causes a function to end and sends a value back to the part of the pro gram that called the function.
End
Send
Exit
Return
This is a design tool that describes the input, processing, and output of a function. a. Hierarchy chart
Hierarchy chart
IPO chart
Datagram chart
Data processing chart
This type of function returns either True or False.
Binary
True_false
Boolean
Logical
This is a math module function.
Derivative
Factor
Sqrt
Differentiate
This is a section of code that gracefully responds to exceptions.
Exception generator
Exception manipulator
Exception handler
Exception monitor
You write this statement to respond to exceptions.
Run/handle
Try/except
Try/handle
Attempt/except
The phrase “divide and conquer” means that all of the programmers on a team should be divided and work in isolation.
True
False
Functions make it easier for programmers to work in teams.
True
False
Function names should be as short as possible.
True
False
Calling a function and defining a function mean the same thing.
True
False
A flowchart shows the hierarchical relationships between functions in a program.
True
False
A hierarchy chart does not show the steps that are taken inside a function.
True
False
A statement in one function can access a local variable in another function.
True
False
In Python, you cannot write functions that accept multiple arguments.
True
False
In Python, you can specify which parameter an argument should be passed into a func tion call.
True
False
You cannot have both keyword arguments and non-keyword arguments in a function call.
True
False
Some library functions are built into the Python interpreter.
True
False
You do not need to have an import statement in a program to use the functions in the random module.
True
False
Complex mathematical expressions can sometimes be simplified by breaking out part of the expression and putting it in a function.
True
False
A function in Python can return more than one value.
True
False
IPO charts provide only brief descriptions of a function’s input, processing, and output, but do not show the specific steps taken in a function
True
False
If you do not handle an exception, it is ignored by the Python interpreter and the program continues to execute.
True
False
You can have more than one except clause in a try/except statement.
True
False
The else suite in a try/except statement executes only if a statement in the try suite raises an exception.
True
False
The finally suite in a try/except statement executes only if no exceptions are raised by statements in the try suite.
True
False
When working with a sequential access file, you can jump directly to any piece of data in the file without reading the data that comes before it.
True
False
When you open a file that file already exists on the disk using the 'w' mode, the contents of the existing file will be erased.
True
False
The process of opening a file is only necessary with input files. Output files are automatically opened when data is written to them.
True
False
When an input file is opened, its read position is initially set to the first item in the file.
True
False
When a file that already exists is opened in append mode, the file's existing contents are erased.
True
False
The keys in a dictionary must be mutable objects.
True
False
You can remove an element from a tuple by calling the tuple’s remove method.
True
False
A list can be an element in another list.
True
False
You can use the + operator to concatenate two lists.
True
False
A file object’s writelines method automatically writes a newline ('\n') after writing each list item to the file.
True
False
Assume list1 references a list. After the following statement executes, list1 and list2 will reference two identical but separate lists in memory: list2 = list1
True
False
The del statement deletes an item at a specified index in a list.
True
False
Tuples in Python are immutable.
True
False
Lists in Python are immutable.
True
False
When you call a string’s split method, the method divides the string into two substrings.
True
False
The repetition operator (*) works with strings as well as with lists
True
False
The isupper method converts a string to all uppercase characters.
True
False
You can use the for loop to iterate over the individual characters in a string.
True
False
Once a string is created, it cannot be changed.
True
False
The remove method raises an exception if the specified element is not found in the set.
True
False
You can store duplicate elements in a set.
True
False
Sets store their elements in an unordered fashion.
True
False
The following statement creates an empty set: myset = set()
True
False
The following statement creates an empty dictionary: mydct = {}
True
False
The dictionary method 'popitem' does not raise an exception if it is called on an empty dictionary.
True
False
A tuple can be a dictionary key.
True
False
Dictionaries are not sequences.
True
False
{"name":"أنظمة مدمجة", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"This operator can be used to find the symmetric difference of two sets., This operator can be used to find the intersection of two sets., This operator can be used to find the difference of two sets.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}