instructions = Given an int array length 2, return True if it contains a 2 or a 3.
def has23(nums):
if nums[0] == 2 or nums[0]== 3 :
return True
elif nums[1] == 2 or nums[1]==3 :
return True
else:
return False
请您参考如下方法:
试试这个:
def has23(nums):
return 2 in nums or 3 in nums
