Can someone do this first function? Using python and API!
API KEY: 8bb45882c0894d8c1ad25a8dcc157c09
PYTHON CODE:
# importing the tmdbsimple api
import tmdbsimple as tmdb
# using the provided key
tmdb.API_KEY='8bb45882c0894d8c1ad25a8dcc157c09'
# function begins
def get_movie_recommendations(lst):
# temporary list to store the movie
titles
r=[]
# looping through every id in the list
for i in lst:
# creating movie
object
movie=tmdb.Movies(i)
# if the id is
valid,
if movie.id:
# getting response dictionary from movie object
response=movie.info()
# if the popularity is greater than 20, then added to the
list
if response['popularity'] > 20:
r.append(movie.title)
# returning the list
return r
# testing
if __name__=='__main__':
print(get_movie_recommendations([346364,17473,603]))
print(get_movie_recommendations([672,314,12142,325245]))
SCREENSHOT FOR OUTPUT:
Can someone do this first function? Using python and API! API KEY: 8bb45882c0894d8c1ad25a8dcc157c09 Function name: get_movie_recommendations Parameters:...
Language: Python Topic: API and JSON Function name: min_pop_countries Parameters: region (str), num (int) Return: list of tuples Description: You are working on a project for your Demography class and you are tasked with finding the top num most populous countries in a given region . Instead of looking up on the Internet, you decide to apply your CS1301 knowledge of APIs and write a function to solve the problem for you. Develop a function that takes in a region...