Data Science · Python What is the output of print(sorted({'a': 3, 'b': 1, 'c': 2}.values())) in Python? print(sorted({'a': 3, 'b': 1, 'c': 2}.values())) A [3, 2, 1] B [1, 3, 2] C [1, 2, 3] Correct answer D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which module creates temporary files and directories in Python? A temp B tempfile Correct answer C tmp D scratch MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of print('ab'.removesuffix('b')) in Python? print('ab'.removesuffix('b')) A ab B b C Error D a Correct answer MCQSEXAM Show answer Read explanation
Data Science · Python What does df.dropna() do in Python? A Fills missing values B Removes rows with missing values Correct answer C Counts missing values D Drops columns only MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of print(7.5 // 2) in Python? print(7.5 // 2) A 3 B 2.0 C 3.0 Correct answer D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which module offers thread-based concurrency in Python? A multiprocessing only B asyncio only C subprocess only D threading Correct answer MCQSEXAM Show answer Read explanation
Data Science · Python What does mypy do in Python? A Runs the program faster B Statically checks type hints without running the code Correct answer C Formats code D Compiles Python to C MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? from functools import wraps def d(f): @wraps(f) def wrapper(): return f() return wrapper @d def hello(): pass print(hello.__name__) A hello Correct answer B wrapper C Error D None MCQSEXAM Show answer Read explanation
Data Science · Python What does python -c 'print(1+1)' do? A Compiles a file B Checks code style C Runs the code string given on the command line Correct answer D Clears the cache MCQSEXAM Show answer Read explanation
Data Science · Python Which tool is commonly used to manage multiple dependency sets and lock files in modern Python projects? A Poetry Correct answer B Cython C Jinja D Gunicorn MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? d = {'a': 1, 'b': 2} print(d.popitem()) A ('a', 1) B b C ('b', 2) Correct answer D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which module computes hashes like SHA-256 in Python? A crypt B hashing C hashlib Correct answer D digest MCQSEXAM Show answer Read explanation
Data Science · Python What is a memory leak candidate in Python even with garbage collection? A Using integers B Using local variables C Objects kept alive by lingering references Correct answer D Using loops MCQSEXAM Show answer Read explanation
Data Science · Python Which approach is generally faster for concatenating many strings in a loop in Python? A Using += repeatedly B Using + inside a nested loop C ''.join(list_of_strings) Correct answer D Using format() each time MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of print(1 << 3) in Python? print(1 A 16 B 4 C Error D 8 Correct answer MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? d = {'a': 1, 'b': 2} try: for k in d: d['c'] = 3 except RuntimeError: print('RuntimeError') A {'a': 1} B None C RuntimeError Correct answer D KeyError MCQSEXAM Show answer Read explanation
Data Science · Python What does os.environ provide in Python? A A mapping of environment variables Correct answer B The Python path C The OS name D A list of processes MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? class A: def __init__(self): print('A init') class B(A): def __init__(self): print('B init') B() A A init B Error C B init Correct answer D None MCQSEXAM Show answer Read explanation
Data Science · Python What does sys.argv contain in Python? A System variables B Command-line arguments passed to the script Correct answer C Python version D Imported modules MCQSEXAM Show answer Read explanation
Data Science · Python Which module offers object-oriented filesystem paths in Python? A pathlib Correct answer B path C fs D filepath MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? a = [1, 2, 3] a.remove(2) print(a) A [1, 3] Correct answer B [2, 3] C [1, 2] D [3] MCQSEXAM Show answer Read explanation
Data Science · Python What does del a[0] do on a list a in Python? A Deletes the whole list B Removes the first element Correct answer C Sets the first element to None D Returns the first element MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? for i, c in enumerate('ab'): print(c, i) A 0 a 1 b B a b C a 0 b 1 Correct answer D Error MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of print((1, 2, 1, 3, 1).count(1)) in Python? print((1, 2, 1, 3, 1).count(1)) A 2 B 1 C (1, 2, 3) D 3 Correct answer MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of the following Python code snippet? a = 256; b = 256 x = [1]; y = [1] print(a is b, x is y) A True False Correct answer B True True C False False D False True MCQSEXAM Show answer Read explanation