add task 106

This commit is contained in:
Grzegorz Rogozik 2020-01-12 15:16:54 +01:00
parent 9115788a7d
commit 601a4c9167

View File

@ -3,13 +3,12 @@
"""Rozwiązanie zadania 106.""" """Rozwiązanie zadania 106."""
def freq_dic(seq): def penultimate(list,otherwise):
"""Placeholder""" if len(list)<=1:
dictionary = {} obj = otherwise
else:
n = len(list)
n = n-2
obj = list[n]
return obj
for xxx in seq:
if dictionary.has_key(xxx):
dictionary[xxx] += 1
else:
dictionary[xxx] = 1
return dictionary