generated from justuser-31/code_projects_template
Решения на первый блок
This commit is contained in:
@@ -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}
|
||||
''')
|
||||
Reference in New Issue
Block a user