38.
How do you work with A) Use appropriate encoding and decoding
JSON data that contains techniques (e.g., json.dumps(data,
special characters? ensure_ascii=False)), B) Special characters are
automatically handled by the json library., C) Avoid
using special characters in JSON data., D) Manually
replace special characters with escape sequences.
39. What are some A) Data exchange between client and server, storing
common use cases for configuration data, and representing structured
JSON in web data., B) Storing images and videos., C) Creating
applications? user interfaces., D) Implementing security features.
40. How do you handle A) By checking the response.status_code and
HTTP errors (e.g., 404, handling errors accordingly., B) By using the try-
500) using the requests except block., C) By ignoring the errors., D) There is
library? no way to handle HTTP errors.
41. How do you A) Using the auth parameter in the requests.get()
authenticate with an method., B) Using the login() function., C) Using the
API using the requests authenticate() method., D) By manually adding
library? authentication headers.
42. What are some A) Avoid exposing API keys, use HTTPS, and validate
common security all input and output., B) Use public Wi-Fi for all API
considerations when requests., C) Make as many requests as possible to
making API requests? test API limits., D) Only use APIs from trusted
sources.
43. Which library is used to A) ipywidgets, B) tkinter, C) pyqt, D) matplotlib
create interactive
widgets in Jupyter
Notebooks/ Colab?
44. What is the purpose of A) To create simple interactive widgets, B) To
the interact function inhandle complex user interactions, C) To display
ipywidgets? images, D) To create custom layouts
45. How do you create a A) dropdown =
dropdown menu in widgets.Dropdown(options=['Option 1', 'Option
ipywidgets? 2']), B) dropdown = widgets.Menu(options=['Option
1', 'Option 2']), C) dropdown =
widgets.Select(options=['Option 1', 'Option 2']), D)
dropdown = widgets.Choice(options=['Option 1',
'Option 2'])
46. How do you create a A) checkbox = widgets.Checkbox(), B) checkbox =
checkbox in ipywidgets? widgets.Check(), C) checkbox = widgets.Boolean(),
D) checkbox = widgets.Toggle()
47. What is a list A) A concise way to create lists, B) A type of loop, C)
comprehension in A data structure for storing unique elements, D) A
Python? function for generating random numbers
48. What is a generator in A) A function that returns an iterator, B) A type of
Python? loop, C) A data structure for storing large amounts
of data, D) A way to create new functions
49. How do you create a A) By using the yield keyword, B) By using the
generator function in generator() function, C) By using the
Python? create_generator() function, D) By using the iter()
function