Mar-24-2021, 02:25 AM
I don't see why you would want to
quit ()
after printing True or False only once. Try it like this as see if it does what you're expecting.def has_33(nums): length = len (nums) - 1 for i in range (length): if nums [i] == 3 and nums [i+1] == 3: return True return False print (has_33([1, 3, 1, 3])) print (has_33([3, 1, 3])) print (has_33([1, 3, 3]))