Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. x = False
  2. y = 0
  3. final = 0
  4. for i in numbers:
  5. if i == 2:
  6. y += 1
  7. x = True
  8. if i == 5:
  9. x = False
  10. if x and i == 2:
  11. if y != 1:
  12. final += i
  13. elif x and i != 2:
  14. final += i
  15. return final
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement