Question: OMDB_API_Key = '7637104b' How would I define a functiongetOMDBDatathat accepts a title and calls the OMDB API (described here:http://www.omdbapi.com) to get the data about that
OMDB_API_Key = '7637104b'
How would I define a functiongetOMDBDatathat accepts a title and calls the OMDB API (described here:http://www.omdbapi.com) to get the data about that movie.
I'd like to use the "By ID or Title" features of the OMDB API.
Requirements:
- If the user does not have an internet connection, the function should return thebooleanFalse. (Use try/except to make this happen.)
- If the user enters an invalid title, the function should return thebooleanFalse. Note that when the title is invalid, OMDB sends back data where the 'Response' field is set to 'False' (a string)
- the requests.get call should only specify two URL parameters:
- for the title and
- for the API key
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
