*All questions refer to Python* QUESTION 41 Attributes are to variables, as meth
ID: 3582719 • Letter: #
Question
*All questions refer to Python*
QUESTION 41
Attributes are to variables, as methods are to ______________.
declarations
objects
functions
exceptions
2 points
QUESTION 42
Programming method of solving a problem by solving a smaller version of the same problem, repeatedly
Repetition
Problem Solving
Debugging
Recursion
2 points
QUESTION 43
Function used to close a file once the program is done with that file.
end()
close()
finish()
detach()
2 points
QUESTION 44
The len() function accepts an object and returns:
the object’s size in kilobytes.
the number of elements in the object.
part of the object.
number of parameters in the object
2 points
QUESTION 45
_____ are part of the UML and is used to illustrate how your program’s functions will relate and support your organization’s various functions.
Flowcharts
Use case diagrams
Class diagrams
Communication diagrams
2 points
QUESTION 46
Comments in Python begin with:
//
/>
*
#
2 points
QUESTION 47
A UML diagram used to examine the various states that any objects will go through at various points in time
State machine diagrams
Use case diagrams
Communication diagrams
Object diagrams
2 points
QUESTION 48
The simplest way to produce output is using the _____ statement
Get
Try
Use
2 points
QUESTION 49
Separates the keys when defining the contents of a dictionary.
(
{
:
[
2 points
QUESTION 50
Statement used to delete a dictionary element
remove
del
erase
terminate
2 points
QUESTION 51
Which of the following is NOT a number type supported by python
char
int
long
float
2 points
QUESTION 52
What is the output of the following Python code:
SIZE = 10
numbers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
index = 0
while index < SIZE:
numbers[index] = index * 10
index = index + 1
while index > 0:
index = index - 1
print(numbers[index])
declarations
objects
functions
exceptions
Explanation / Answer
The answers are mostly sef explanatory.PFB answers
41.Objects
42.Recursion
43.close()
44.the number of elements in the object.
Len returns the number of characters in a string. It counts spaces, punctuation, all characters the same.
45.Class diagram.
46. #
47. State machine diagrams
48.Print
49.:
50.del
51.char.
Python supports 4 types of number types.
int,long,float,complex.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.