Исправлена ошибка с границей цикла lab_2/func.py

parent bfbdde4f
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
func.py: func.py:
```python ```python
def check_sum(nums, target): def check_sum(nums, target):
for i in range(len(nums)): for i in range(len(nums) - 1):
for j in range(i + 1, len(nums)): for j in range(i + 1, len(nums)):
if nums[i] + nums[j] == target: if nums[i] + nums[j] == target:
return [i, j] return [i, j]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment