Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def has246(nums):
- """docstring"""
- result = []
- for index in range(len(nums)):
- if num == 2 and nums[index + 1] == 4 and nums[index + 2] == 6:
- return True
- else:
- return False
- #test cases
- print(has246([2, 2, 4, 6, 2]))
- print(has246([2, 2, 4, 8, 2]))
- print(has246([2, 4]))
Advertisement
Add Comment
Please, Sign In to add comment