def mul(): sum=0 for i in range(1001): if i>0: if(i%3==0 or i%5==0): sum=sum+1 return sum
function calculate_multiples {$SUM = 01..999 | ForEach-Object {if (!( $_ % 3) -OR !($_ % 5)) {$Sum += $_}}return $Sum}- def mul():
- sum=0
- for i in range(1001):
- if i>0:
- if(i%3==0 or i%5==0):
- sum=sum+1
- return sum