Spaces:
Runtime error
Runtime error
| # Simple movie recommendations by genre | |
| movie_recommendations = { | |
| "comedy": {"title": "Palm Springs (2020)", "image_url": "https://image-url.com/palm-springs.jpg"}, | |
| "action": {"title": "Tenet (2020)", "image_url": "https://image-url.com/tenet.jpg"}, | |
| "drama": {"title": "Nomadland (2020)", "image_url": "https://image-url.com/nomadland.jpg"}, | |
| "romance": {"title": "The Half of It (2020)", "image_url": "https://image-url.com/the-half-of-it.jpg"}, | |
| "thriller": {"title": "The Invisible Man (2020)", "image_url": "https://image-url.com/the-invisible-man.jpg"} | |
| } | |
| # Ask user for their preferred genre | |
| genre_input = input("Enter your preferred genre (comedy, action, drama, romance, thriller): ").lower() | |
| # Fetch the movie recommendation | |
| movie = movie_recommendations.get(genre_input, None) | |
| if movie: | |
| print(f"We recommend you watch '{movie['title']}'!") | |
| print(f"Movie Image: {movie['image_url']}") | |
| else: | |
| print("Sorry, we couldn't find a recommendation for that genre.") | |