Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- place = int(input())
- lst = [ ]
- count = 0
- for i in range(place):
- ele = int(input())
- lst.append(ele)
- for i in range(place):
- if lst[i] == 1:
- count += 1
- for j in range(n):
- if i + j > place:
- break
- print(lst.count(1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement