Иван обнови решението на 22.03.2015 23:00 (преди над 9 години)
+def extract_type(params, used_type):
+ work_string = ''
+ for i in range(0, len(params)):
+ if type(params[i][0]) is used_type:
+ work_string += params[i][1]*str(params[i][0])
+ else:
+ pass
+ return work_string
+
+
+def reversed_dict(dictionary):
+ work_dick = {}
+ work_list = list(dictionary.keys())
+ for i in range(0, len(work_list)):
+ work_dick[dictionary[work_list[i]]] = work_list[i]
+ return work_dick
+
+
+def reps(dict_or_tuppl):
+ work_list = list()
+ for i in range(0, len(dict_or_tuppl)):
+ for j in range(0, len(dict_or_tuppl)):
+ if i == j:
+ pass
+ elif dict_or_tuppl[i] == dict_or_tuppl[j]:
+ work_list.append(dict_or_tuppl[i])
+ break
+ else:
+ pass
+ return tuple(work_list)