From 9016442dda396dc3274170f505d1ba212583eca9 Mon Sep 17 00:00:00 2001 From: Yesen Date: Thu, 26 Oct 2023 12:56:00 +0300 Subject: [PATCH] additions to positional and keyword args --- docs/python/test.py | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/python/test.py diff --git a/docs/python/test.py b/docs/python/test.py new file mode 100644 index 0000000..59a0f71 --- /dev/null +++ b/docs/python/test.py @@ -0,0 +1,46 @@ +# # i номер строки +# # j номер столбца + +# n = int(input()) +# a = [[0 for j in range (n)] for i in range (n)] +# #выше сделала квадратную матрицу с сторонами n заполненную нулями +# for num in range(1,(n**2)+1): +# for i in range(n): +# for j in range(n): +# print (a) + + +# lst = (int(i) for i in input().split()) +# l = [1,2,3,4,5] +# def modify_list(l): +# # i = int(i) +# for i in reversed(range(len(l))): +# if i % 2 !=0: +# del l[i] +# else: +# l[i] //= 2 +# print(modify_list(l)) +# print(l) +# modify_list(l) +# print(l) +l= [1, 3, 5] +def modify_list(l): + for i in range(len(l))[::-1]: + if l[i] %2 !=0: + l.remove(l[i]) + else: + l[i] = l[i]//2 +modify_list(l) +print(l) +# l = [1,2,3,4] +# def modify_list(l): +# l[:] = [i//2 for i in l if not i % 2] +# modify_list(l) +# print(l) + + + + + + + \ No newline at end of file