The map() function applies the square function to each element in the numbers list.
Discuss About this Question.
What is the purpose of the min() function?
A:
Finds the minimum value in a list
B:
Rounds a floating-point number down to the nearest integer
C:
Checks if a variable is of a certain type
D:
Converts a string to lowercase
Answer:A
The min() function is used to find the minimum value among the elements of an iterable, such as a list.
Discuss About this Question.
What does the term "variable scope" refer to?
A:
The lifetime of a variable
B:
The region of the program where a variable can be accessed
C:
The data type of a variable
D:
The value assigned to a variable
Answer:B
Variable scope refers to the part of the program where a variable is accessible.
Discuss About this Question.
What is the purpose of the __init__() method in Python classes?
A:
Initializes the class object
B:
Declares a new instance variable
C:
Defines the class constructor
D:
Prints the class attributes
Answer:C
The __init__() method is a special method in Python classes that is automatically called when a new instance of the class is created. It is used to initialize the object's attributes.
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.