예제 #1
0
def commandPT(commands, mm):
    title = commands[1]
    if not mml.has_movies(mm):
        print("Sem filmes registados.")
    elif not mml.has_movie_with_title(mm, title):
        print("Sem resultados.")
    else:
        movies = mml.get_movies_by_title(mm, title)
        for movie in movies:
            director_name = movie['director']['name']
            print(f"{director_name} {title}")
예제 #2
0
def commandPR(commands, mm):
    director_name = commands[1]
    if not mml.has_movies(mm):
        print("Sem filmes registados")
    elif not mml.has_director(mm, director_name):
        print("Realizador inexistente")
    elif not mml.has_movie_by_director(mm, director_name):
        print("Sem resultados")
    else:
        movies = mml.get_movies_by_director(mm, director_name)
        for movie in movies:
            director_name = ['director']['name']
            title = movie['title']
            print(f"{director_name} {title}")