write a Python program that creates a list of all the integers less than 100 that are multiples of 3 or 5 !!
Plzz do it ASAP !!
Answers
Answered by
12
Answer:
Explanation:nums = [3, 5]
max = 999
result = 0
for num in nums:
for i in range(1,max):
if num*i < max:
result += num*i
print result
result = 0
for i in range(0,max):
if i%3 == 0 or i%5 == 0:
result += i
print result
ASweety1431:
excuse me ???
Answered by
11
The code is,
import numpy as np
x = np.arange(1, 100)
n= x[(x % 3 == 0) | (x % 5 == 0)]
print(n[:100])
Similar questions
Computer Science,
6 months ago
Geography,
6 months ago
Math,
6 months ago
English,
11 months ago
Chemistry,
11 months ago