Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Найдите сумму всех чисел меньше 1000, кратных 3 или 5.
- i = 0
- list = []
- while i < 1000:
- if i % 3 == 0 or i % 5 == 0:
- list.append(i)
- print(i)
- i += 1
- sum = 0
- j = 0
- while j < len(list):
- sum += list[j]
- j += 1
- print(sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement