30 lines
472 B
Python
30 lines
472 B
Python
#!/usr/bin/env python3
|
|
# coding: utf8
|
|
|
|
"""115-multiples-of-3-and-5.py"""
|
|
|
|
def multiple_35(number):
|
|
"""
|
|
:Examples:
|
|
>>> print(multiple_35(20))
|
|
[3, 5, 6, 9, 10, 12, 15, 18]
|
|
"""
|
|
return [num for num in range(1, number) if num % 3 == 0 or num % 5 == 0]
|
|
|
|
|
|
def main(number):
|
|
"""
|
|
:Examples:
|
|
>>> main(20)
|
|
78
|
|
"""
|
|
|
|
return sum(multiple_35(number))
|
|
|
|
print(main(1000))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import doctest
|
|
doctest.testmod()
|