Which Python library is specifically designed for creating static, interactive, and real-time graphs and plots?
- Matplotlib
- NumPy
- Pandas
- Seaborn
Matplotlib is specifically designed for creating static, interactive, and real-time graphs and plots in Python. It is a widely-used plotting library for data visualization.
Which Python library would you use for implementing machine learning algorithms and is known for its simplicity and efficiency?
- Matplotlib
- Numpy
- Pandas
- Scikit-learn
Scikit-learn (or sklearn) is a widely-used Python library for machine learning. It provides a simple and efficient way to implement various machine learning algorithms, making it a popular choice among data scientists and developers.
Which Python library would you use to perform elementary matrix operations and computations?
- Matplotlib
- NumPy
- Pandas
- TensorFlow
You would use the NumPy library for elementary matrix operations and computations. NumPy provides a powerful array object and functions to manipulate arrays efficiently.
Which Python module is commonly used for writing unit tests?
- debugger
- logging
- pytest
- unittest
The unittest module is commonly used in Python for writing unit tests. It provides a testing framework to create and run test cases and manage test suites. While pytest is another popular testing framework, it's not a module but an external library. debugger and logging are unrelated to writing unit tests.
Which Python module provides a set of functions to help with debugging and interactive development?
- debug
- debugutil
- inspect
- pdb
The Python module pdb (Python Debugger) provides a set of functions for debugging and interactive development. It allows you to set breakpoints, step through code, inspect variables, and more.
Which Python module provides a set of tools for constructing and running scripts to test the individual units of your code?
- assert
- debugger
- sys
- unittest
The unittest module in Python provides a framework for writing and running unit tests. It allows you to create test cases and test suites to verify the correctness of your code's individual units or functions.
Which Python module would you use for logging error and debugging messages?
- debug
- logging
- sys
- trace
The logging module is commonly used for logging error and debugging messages in Python. It provides a flexible and configurable way to manage logs in your applications.
Which Python module would you use for measuring the performance of small code snippets?
- benchmark
- datetime
- profiling
- timeit
You would use the timeit module to measure the performance of small code snippets in Python. It provides a simple way to time small bits of Python code and is a useful tool for optimizing code.
Which Python tool would you use to visualize an application’s call stack and identify performance bottlenecks?
- cProfile
- Gunicorn
- Pyflame
- Pygraphviz
Pyflame is a tool for profiling Python applications. It helps visualize the call stack and identify performance bottlenecks. cProfile (Option 1) is a built-in profiler, but it doesn't offer visualization. Gunicorn (Option 3) is a web server. Pygraphviz (Option 4) is for graph visualization, not profiling.
Which Python web framework uses the “Don’t repeat yourself” principle?
- Django
- Flask
- Pyramid
- Tornado
Django is a Python web framework that follows the "Don't repeat yourself" (DRY) principle. DRY encourages developers to avoid duplicating code by providing reusable components and an organized structure.