Given an int array length 2, return True if it contains a 2 or a 3. I can't use loops. Most of the test cases work except:
has23([4, 5]) --> False (my code returns True)
has23([7, 7]) --> False (my code returns True)
has23([9, 5]) --> False (my code returns True)
My code:
def has23(nums):
if 2 or 3 in nums[0:1]:
return True
else:
return False