Виктор обнови решението на 29.10.2022 20:00 (преди над 2 години)
▸ Покажи разликите+import re
+
+
+def nums_to_text(nums):
+ return re.sub(r'[^A-Z\.]+', ' ', '.'.join(chr(58+int(m[0][0])*3+(int(m[0][0])//8)+(len(m[0])%(3+(m[0][0] in '79')) or 3+(m[0][0] in '79'))) for m in re.findall(r'((?P<first>[2-90])(?P=first)*)', ''.join(str(n) for n in nums)))).replace('.', '')
+
+def text_to_nums(text):
+ return [int(num) for num in re.findall(r'-?\d', re.sub(r'(?<=(?P<first>\d))\.(?=(?P=first))', '.-1.','.'.join([{chr(i):str((i-59)//3-(i in (83,86,89,90)))*((i-64-(i>82))%3+4*(i==83)+3*(i==90) or 3) for i in range(65, 91)}.get(char, '0') for char in (c.upper() for c in text)])))]
+
+def nums_to_angle(nums):
+ return sum([([30*num for num in range(1,10)]+[300])[i%10-1] for i in nums])%360
+
+def angles_to_nums(angles):
+ return [filtered for filtered in (([300]+[30*num for num in range(1,10)]+[0,330]).index((30*round(angle/30-0.00000001)+360)%360) for angle in angles) if filtered<10]
+
+def is_phone_tastic(word):
+ return not nums_to_angle(text_to_nums(word)) % len(word) if word else False