Решения на первый блок

This commit is contained in:
2025-03-25 12:39:42 +03:00
parent 1e61635a97
commit 7f72988d8b
12 changed files with 280 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
from random import randint
nums = []
for i in range(10):
nums.append(randint(1, 100))
def rmin(nums, l_len = len(nums), i = None):
# If we at the end
if i == l_len - 1:
return nums[i]
# If main fun (we just started)
if i == None:
i = 0
# Compare next i and current i
n_i = rmin(nums, l_len, i+1)
if n_i < nums[i]:
return n_i
else:
return nums[i]
min = rmin(nums)
print(f'''Original list:
{nums}
Min: {min}
''')