def get_sinhala_films(year): url = f"https://example-api.com/sinhala-films?year={year}" response = requests.get(url) return response.json()
def display_film_details(film): print(f"Title: {film['title']}") print(f"Director: {film['director']}") print(f"Cast: {film['cast']}") print(f"Plot: {film['plot']}")
# Get Sinhala films from 2021 and 2024 films_2021 = get_sinhala_films(2021) films_2024 = get_sinhala_films(2024)
# Display film details for film in films_2021: display_film_details(film)
for film in films_2024: display_film_details(film) This example assumes a fictional API that returns a list of Sinhala films for a given year. The display_film_details function prints out the details of each film. You can adapt this code to fit your specific requirements and data sources.
Here's a basic example using Python and a fictional API:
import requests