- Which module is used for mathematical functions?
View Answer
Correct answer: A — math
- What will be printed?
1 python 2 import math 3 print(math.sqrt(16)) View Answer
Correct answer: A — 4.0
- Which module is used for generating random numbers?
View Answer
Correct answer: A — random
- What is the output of print(random.randint(1,3))?
View Answer
Correct answer: A — 1,2 or 3
- Which module is used for handling operating system tasks?
View Answer
Correct answer: A — os
- What will be printed?
1 python 2 import os 3 print(os.name) View Answer
Correct answer: A — posix or nt
- Which module is used for system specific parameters?
View Answer
Correct answer: A — sys
- What is the output of print(sys.version.split()[0])?
View Answer
Correct answer: A — Python version number
- Which module is used for date and time manipulation?
View Answer
Correct answer: A — datetime
- What will be printed?
1 python 2 import datetime 3 print(datetime.date.today().year) View Answer
Correct answer: A — Current year
- Which module is used for time related functions?
View Answer
Correct answer: A — time
- What is the output of print(time.sleep(1))?
View Answer
Correct answer: A — None
- Which module is used for calendar operations?
View Answer
Correct answer: A — calendar
- What will be printed?
1 python 2 import calendar 3 print(calendar.isleap(2024)) View Answer
Correct answer: A — True
- Which module is used for collections like Counter?
View Answer
Correct answer: A — collections
- What is the output of below code?
1 python 2 from collections import Counter 3 print(Counter("Eduinq")) View Answer
Correct answer: A — Counter({'E':1,'d':1,'u':1,'i':1,'n':1,'q':1})
- Which module is used for functional programming tools?
View Answer
Correct answer: A — functools
- What will be printed?
1 python 2 from functools import reduce 3 print(reduce(lambda x,y:x+y,[1,2,3])) View Answer
Correct answer: A — 6
- Which module is used for iterator building blocks?
View Answer
Correct answer: A — itertools
- What is the output of print(list(itertools.permutations([1,2],2)))?
View Answer
Correct answer: A — [(1,2),(2,1)]
- Which module is used for high performance array operations?
View Answer
Correct answer: A — array
- What will be printed?
1 python 2 import array 3 a = array.array('i',[1,2,3]) 4 print(a[1]) View Answer
Correct answer: A — 2
- Which module is used for file pattern matching?
View Answer
Correct answer: A — glob
- What is the output of print(glob.glob("*.py"))?
View Answer
Correct answer: A — List of Python files
- Which module is used for file operations like copy?
View Answer
Correct answer: A — shutil
- What will be printed?
1 python 2 import shutil 3 print(hasattr(shutil,"copy")) View Answer
Correct answer: A — True
- Which module is used for subprocess management?
View Answer
Correct answer: A — subprocess
- What is the output of below code?
1 python 2 import subprocess 3 print(type(subprocess.run(["echo","Eduinq"]))) View Answer
Correct answer: A — CompletedProcess
- Which module is used for JSON operations?
View Answer
Correct answer: A — json
- What will be printed?
1 python 2 import json 3 print(json.dumps({"Eduinq":1})) View Answer
Correct answer: A — {"Eduinq":1}
- Which module is used for CSV operations?
View Answer
Correct answer: A — csv
- What is the output of below code?
1 python 2 import csv 3 print(hasattr(csv,"reader")) View Answer
Correct answer: A — True
- Which module is used for XML parsing?
View Answer
Correct answer: A — xml.etree.ElementTree
- What will be printed?
1 python 2 import xml.etree.ElementTree as ET 3 root = ET.Element("Eduinq") 4 print(root.tag) View Answer
Correct answer: A — Eduinq
- Which module is used for serialization?
View Answer
Correct answer: A — pickle
- What is the output of below code?
1 python 2 import pickle 3 print(hasattr(pickle,"dump")) View Answer
Correct answer: A — True
- Which module is used for compression?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 python 2 import gzip 3 print(hasattr(gzip,"open")) View Answer
Correct answer: A — True
- Which module is used for hashing?
View Answer
Correct answer: A — hashlib
- What is the output of below code?
1 python 2 import hashlib 3 print(hashlib.md5(b"Eduinq").hexdigest()) View Answer
Correct answer: A — MD5 hash string
- Which module is used for regular expressions?
View Answer
Correct answer: A — re
- What will be printed?
1 python 2 import re 3 print(re.search("Edu","Eduinq").group()) View Answer
Correct answer: A — Edu
- Which module is used for decimal arithmetic?
View Answer
Correct answer: A — decimal
- What is the output of below code?
1 python 2 from decimal import Decimal 3 print(Decimal('0.1')+Decimal('0.2')) View Answer
Correct answer: A — 0.3
- Which module is used for fractions?
View Answer
Correct answer: A — fractions
- What will be printed?
1 python 2 from fractions import Fraction 3 print(Fraction(1,3)+Fraction(1,6)) View Answer
Correct answer: A — 1/2
- Which module is used for statistics?
View Answer
Correct answer: A — statistics
- What is the output of below code?
1 python 2 import statistics 3 print(statistics.mean([1,2,3])) View Answer
Correct answer: A — 2
- Which module is used for random sampling?
View Answer
Correct answer: A — random
- What will be printed?
1 python 2 import random 3 print(random.sample([1,2,3,4],2)) View Answer
Correct answer: A — Any 2 random elements