Pthon Libraries – MCQs
1. Which of the following is used for numerical computations in Python?
A. pandas
B. numpy
C. matplotlib
D. tkinter
2. The pandas library is mainly used for:
A. Image processing
B. Game development
C. Data analysis and manipulation
D. Web development
3. Which library is used for data visualization in Python?
A. sklearn
B. numpy
C. matplotlib
D. os
4. What is the full form of Tk in tkinter?
A. Toolkit
B. Touchkit
C. Terminal Kernel
D. Tiny Kit
5. Which of these is a machine learning library?
A. matplotlib
B. seaborn
C. scikit-learn
D. os
6. What is the primary function of os module?
A. Web scraping
B. File and directory operations
C. Graphics design
D. Audio process
7. Which library helps in creating games in Python?
A. pygame
B. numpy
C. bs4
D. pandas
8. Which library is used for web scraping in Python?
A. selenium
B. beautifulsoup (bs4)
C. requests
D. All of the above
9. Which of the following is a deep learning library?
A. TensorFlow
B. numpy
C. pandas
D. tkinter
10. The random module is used to:
A. Generate passwords
B. Sort arrays
C. Pick random numbers or items
D. Encrypt text
11. What does import numpy as np do?
A. Creates a new module
B. Installs numpy
C. Shortens numpy name to np
D. Deletes numpy
12. Which library helps in plotting beautiful statistical graphs?
A. matplotlib
B. pandas
C. seaborn
D. plotly
13. Which of the following is NOT a Python library?
A. pandas
B. torch
C. java.util
D. numpy
14. The math library in Python provides:
A. Network functions
B. Game functions
C. Mathematical functions like sin, cos, sqrt
D. Web server tools
15. Which Python library is best for handling large datasets and tabular data?
A. numpy
B. tkinter
C. pandas
D. random
16. What does the requests library do?
A. Send emails
B. Make HTTP requests
C. Open files
D. Scrape webpages directly
17. Which library is used for working with regular expressions?
A. sys
B. re
C. os
D. glob
18. Which module is used to handle JSON data in Python?
A. json
B. xml
C. http
D. urllib
19. Which library provides interactive plots in web browsers?
A. matplotlib
B. plotly
C. seaborn
D. pygame
20. Which of the following is used to create GUIs in Python?
A. pygame
B. seaborn
C. tkinter
D. plotly
21. The library sklearn stands for:
A. Scalable Kernel
B. Sci-kit Learn
C. Socket Learn
D. Science Kernel
22. What does time.sleep(2) do?
A. Stops the program
B. Pauses execution for 2 seconds
C. Creates a timer
D. Ends the program
23. The calendar module is used to:
A. Make countdown timers
B. Work with date and time
C. Show and manipulate calendars
D. Connect to Google Calendar
24. What is openpyxl used for?
A. Web scraping
B. GUI design
C. Reading and writing Excel files
D. Sending emails
25. Which library is used to create charts in Jupyter notebooks?
A. seaborn
B. matplotlib
C. plotly
D. All of the above
26. What is pip in Python?
A. A built-in function
B. A file extension
C. A package installer
D. A debugger
27. Which of these is used for face and object detection?
A. OpenCV
B. pandas
C. seaborn
D. pyautogui
28. What does from math import sqrt do?
A. Imports the full math library
B. Imports only the sqrt function from math
C. Defines sqrt function
D. Deletes math library
29. Which module is used to generate charts and graphs?
A. chartlib
B. matplotlib
C. diagram
D. tkinter
30. What is the purpose of the sys module?
A. Build websites
B. Handle system-specific parameters and functions
C. Send messages
D. Color images