Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def solution(A):
- result = 0
- for number in A:
- if 9 < number < 100 or -100 < number < -9:
- result += number
- return result
- # --- tests ---
- data = [
- [ [1, 1000, 80, -91], -11 ],
- [ [2, 25, 300, 52, 10], 87 ],
- ]
- for A, correct_result in data:
- result = solution(A)
- print(result, correct_result, result == correct_result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement