(limit)
| 1 | def mulitples(limit): |
| 2 | xmulti = [] |
| 3 | zmulti = [] |
| 4 | z = 3 |
| 5 | x = 5 |
| 6 | temp = 1 |
| 7 | while True: |
| 8 | result = z * temp |
| 9 | if (result < limit): |
| 10 | zmulti.append(result) |
| 11 | temp += 1 |
| 12 | else: |
| 13 | temp = 1 |
| 14 | break |
| 15 | while True: |
| 16 | result = x * temp |
| 17 | if (result < limit): |
| 18 | xmulti.append(result) |
| 19 | temp += 1 |
| 20 | else: |
| 21 | break |
| 22 | collection = list(set(xmulti+zmulti)) |
| 23 | return (sum(collection)) |
| 24 | |
| 25 | |
| 26 |