Не работает рекурсия в дебаге возвращает None?

def compare_watched_anime(watched_list, random_shonen_anime):
if watched_list[top_shonen_anime[random_shonen_anime]['title']]['watched'] is True:
    random_shonen_anime = randint(0, len(top_shonen_anime) - 1)
    watched_array = list()
    for anime_title in watched_list:
        watched_array.append(watched_list[anime_title]['watched'])
    if False not in watched_array:
        return False
    else:
        compare_watched_anime(watched_list, random_shonen_anime)
else:
    return random_shonen_anime

Ответы (1 шт):

Автор решения: Эникейщик

Чтобы возвращало, надо возвращать

else:
    return compare_watched_anime(watched_list, random_shonen_anime)
→ Ссылка