А
Size: a a a
А
А
БГ
l
БГ
max(...) - list.remove(...) - max(...)НХ
НХ
БГ
py3
list_of_array = [[1, 2, 3, 4, 5, 6, 7], [8, 9, 10, 11, 12, 13, 14, 15]]
unpacked_list = [y for x in [*list_of_array] for y in x]
print(unpacked_list)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
py3
nested_lists = [[1, 2, 3, 4, 5, 6, 7], [8, 9, 10, 11, 12, 13, 14, 15]]
unpacked = [item for nested_list in nested_lists for item in nested_list]
print(unpacked)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
БГ
НХ
БГ
Python3
nums = [1,2,3]
print(sum([a for a in nums if a != min(nums)]))
5
R3
БГ
py3
from random import randint
l = list(randint(0, 100) for _ in range(10))
print(l)
l.sort()
print(l)
maxes = l[-2:]
print(maxes)
[83, 14, 84, 59, 48, 20, 24, 34, 97, 55]
[14, 20, 24, 34, 48, 55, 59, 83, 84, 97]
[84, 97]
БГ
py3
from random import randint
l = list(randint(0, 100) for _ in range(10))
print(l)
l.sort()
print(l)
maxes = l[-2:]
print(maxes)
[83, 14, 84, 59, 48, 20, 24, 34, 97, 55]
[14, 20, 24, 34, 48, 55, 59, 83, 84, 97]
[84, 97]
БГ
AT
БГ
R3
l
БГ