Quick actions

cmd+k|ctrl+k

Navigation

Languages

Exercise 3.8fix

Snippet info

Language

Python

Visibility

public

Author

vinhquang-pyt

Created

2016-09-21T02:02:40Z

Updated

2016-09-28T04:07:02Z

primes = list(range(1, 1000))
lst_primes = []
for i in primes:
    if i % 3 == 0 or i % 5 == 0:
        lst_primes.append(i)
print(lst_primes)
print(sum(lst_primes))

lst_primes = [i for i in range(1, 1000) if i % 3 == 0 or i % 5 == 0]
print(lst_primes)
print(sum(lst_primes))
INFO