Guest User

Untitled

a guest
Apr 1st, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. def has246(nums):
  2. """docstring"""
  3. result = []
  4. for index in range(len(nums)):
  5. if num == 2 and nums[index + 1] == 4 and nums[index + 2] == 6:
  6. return True
  7. else:
  8. return False
  9. #test cases
  10. print(has246([2, 2, 4, 6, 2]))
  11. print(has246([2, 2, 4, 8, 2]))
  12. print(has246([2, 4]))
Advertisement
Add Comment
Please, Sign In to add comment