- AOnly when there is no exception
- BNever
- Calways
- DOnly when there is an exception
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
The correct answer is: __init__.py
The correct method to pick a single element randomly from a given list of elements using the random module is:
random.choice()
So, the correct answer is: choice
The exception that occurs when an undefined object is accessed in Python is:
NameError
So, the correct answer is: NameError
The correct expression to check if the file 'C:\Sample.txt' exists and is also a regular file is:
os.path.isfile("C:\Sample.txt")
So, the correct answer is: os.path.isfile("C:\Sample.txt")
True. Any Python script can act like a module. In Python, a module is simply a file containing Python definitions and statements. These modules can be reused in other Python scripts by importing them using the import statement. A Python script becomes a module when it contains reusable code that can be imported into other scripts.
The module used to manage installation, upgrading, and deletion of other packages automatically in Python is:
pip
So, the correct answer is: pip