|
@@ -142,3 +142,63 @@ def get_domain_name(url : str):
|
|
# assert get_domain_name("https://www.mywww.com") == 'mywww'
|
|
# assert get_domain_name("https://www.mywww.com") == 'mywww'
|
|
# print('Проверки пройдены')
|
|
# print('Проверки пройдены')
|
|
|
|
|
|
|
|
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+
|
|
|
|
+def factorial(n):
|
|
|
|
+ fact = 1
|
|
|
|
+ for num in range(2, n + 1):
|
|
|
|
+ fact *= num
|
|
|
|
+ return fact
|
|
|
|
+
|
|
|
|
+def trailing_zeros(n):
|
|
|
|
+ s = str(factorial(n))[::-1]
|
|
|
|
+ l = []
|
|
|
|
+ for i in range(len(s)):
|
|
|
|
+ if s[i] != '0':
|
|
|
|
+ break
|
|
|
|
+ else:
|
|
|
|
+ l.append(s[i])
|
|
|
|
+
|
|
|
|
+ return len(l)
|
|
|
|
+
|
|
|
|
+# assert trailing_zeros(0) == 0
|
|
|
|
+# assert trailing_zeros(6) == 1
|
|
|
|
+# assert trailing_zeros(30) == 7
|
|
|
|
+# assert trailing_zeros(12) == 2
|
|
|
|
+
|
|
|
|
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+
|
|
|
|
+def count_AGTC(dna):
|
|
|
|
+ return dna.count('A'), dna.count('G'), dna.count('T'), dna.count('C')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+assert count_AGTC('AGGTC') == (1, 2, 1, 1)
|
|
|
|
+assert count_AGTC('AAAATTT') == (4, 0, 3, 0)
|
|
|
|
+assert count_AGTC('AGTTTTT') == (1, 1, 5, 0)
|
|
|
|
+assert count_AGTC('CCT') == (0, 0, 1, 2)
|
|
|
|
+print('Проверки пройдены')
|
|
|
|
+
|
|
|
|
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+
|
|
|
|
+def foo():
|
|
|
|
+ "Эта функция делает что-то"
|
|
|
|
+ pass
|
|
|
|
+
|
|
|
|
+# print(foo.__doc__)
|
|
|
|
+
|
|
|
|
+class Model:
|
|
|
|
+ """
|
|
|
|
+ This is class model
|
|
|
|
+ """
|
|
|
|
+ pass
|
|
|
|
+
|
|
|
|
+# help(Model)
|
|
|
|
+# print(Model.__doc__)
|
|
|
|
+
|
|
|
|
+def get_even(lst, number):
|
|
|
|
+ """_summary_
|
|
|
|
+
|
|
|
|
+ Args:
|
|
|
|
+ lst (_type_): _description_
|
|
|
|
+ number (_type_): _description_
|
|
|
|
+ """
|