Apr-28-2020, 10:38 AM
The output of this program is
no
but I think it should be yes
because if condition is true when loop iterate last time(3rd time)
I know I am not right, please help me with the reason of "no"
no
but I think it should be yes
because if condition is true when loop iterate last time(3rd time)
I know I am not right, please help me with the reason of "no"
def fun(a,k):
for x in a:
if x==k:
return 'yes'
else:
return 'no'
print(fun([6,8,5],5))
