Антон обнови решението на 23.03.2015 14:45 (преди над 9 години)
+def extract_type(text, type_):
+ if type_ is str:
+ extracted_info = ''
+ else:
+ extracted_info = 0
+ for i in text:
+ if (type(i[0]) is type_):
+ j = 0
+ while (j < i[1]):
+ extracted_info = extracted_info + i[0]
+ j += 1
+ return extracted_info
+
+
+def reversed_dict(dictionary):
+ new_dict = {v:k for k,v in dictionary.items()}
+ return new_dict
+
+
+def reps(sequence):
+ new_sequence = list()
+ for i in sequence:
+ if(sequence.count(i) > 1):
+ new_sequence.append(i)
+ return tuple(new_sequence)