I have a problem with the for loop Python
I have a problem with the for loop Python Question: I have a problem when using the for loop, I don’t know why my loop is not working as expected. CODE: class Solution: def searchInsert(nums, target): pos = 0 for i in nums: if nums[pos] != target: pos = pos + 1 print(pos) break Solution.searchInsert([1,3,5,6], …
Total answers: 3