Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def how_many_neighbors(x):
- amount = 0
- for index in range(len(x) - 2):
- if x[index] < x[index + 1] > x[index + 2]:
- amount += 1
- return amount
- number_list = list(map(int, input().split()))
- print(how_many_neighbors(number_list))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement