import difflib
game_names = [
'Stardew Valley', 'Portal 2', 'Terraria', 'People Playground', 'Left 4 Dead 2',
'Vampire Survivors', 'Hades', 'Euro Truck Simulator 2', 'Portal', 'RimWorld',
'Lethal Company', 'The Binding of Isaac: Rebirth', "Baldur's Gate 3", 'Bloons TD 6',
'Slay the Spire', 'Hollow Knight', 'Half-Life: Alyx', 'BeamNG.drive',
'Half-Life 2', 'Mount & Blade: Warband', 'Deep Rock Galactic', 'Slime Rancher',
'ULTRAKILL', 'Totally Accurate Battle Simulator', 'HoloCure - Save the Fans!'
]
def finder(search_name):
# Используем функцию get_close_matches для поиска похожих названий
matches = difflib.get_close_matches(search_name, game_names, n=1, cutoff=0.0)
return matches[0] if matches else None
search_game = "Stardew Valley"
most_similar_game = finder(search_game)
if most_similar_game:
print("Самая похожая игра:", most_similar_game)
else:
print("Похожих игр не найдено.")