Please help me with this I’m not able to omit number of multiple x
JavaScript
x
7
1
For i in range(0,n+1):
2
if(i%6==0):
3
Continue
4
Sum=sum+i
5
print(int(sum))
6
print(sum)
7
Advertisement
Answer
Keywords such as for
and continue
shouldn’t be capitalized:
If you’re trying to find the sum of numbers that are not multiples of x then you can try this:
JavaScript
1
9
1
total = 0
2
n = int(input("Enter n: "))
3
x = int(input("Enter x: "))
4
for i in range(0,n+1):
5
if(i%x==0):
6
continue
7
total += i
8
print(total)
9