Given this code:
nums = [1,2,3]
def test1(nums):
for i in nums:
if i == 1:
return True
return False
test1(nums)
The result is True even though after the for loop there is a return False. What am I missing?
Given this code:
nums = [1,2,3]
def test1(nums):
for i in nums:
if i == 1:
return True
return False
test1(nums)
The result is True even though after the for loop there is a return False. What am I missing?