Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array = {} # создаем пустой массив
- count = int(input("Count = ")) # размер массива
- dict = {} # словарь
- for i in range(count): # ввод строк
- array[i] = input("Element[" + str(i) + "] = ")
- dict[array[i]] = len(array[i])
- dict = sorted(dict.items(), key=lambda x: x[1], reverse=True) # сортируем
- for i in range(count): # выводим
- print(dict[i][0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement