HomeInterview QuestionsI wrote the line `response = request.get(API_URL)`…

I wrote the line `response = request.get(API_URL)`. What is wrong with this?

🟢 Easy Debugging Fresher level
1Times asked
Jun 2026Last seen
Jun 2026First seen

💡 Model Answer

The correct module name is requests, not request. You should import it with import requests and then call requests.get(API_URL). Also, ensure that API_URL is a string containing the full URL. If you need to handle errors, wrap the call in a try/except block and check response.status_code before accessing response.json().

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500