File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ #Sum of odd multiples of three
12#48- Make a program that calculates the sum of all numbers that are multiples of three and that are in the
23# range from 1 to 500.
34soma = 0
78 counter = counter + 1
89 soma = soma + c
910print (f'The sum of all { counter } requested values is { soma } .' )
11+
12+
13+ #Soma ímpares múltiplos de três
14+ # 48: Faça um programa que calcule a soma entre todos os números que são múltiplos de três e que se encontram no
15+ # intervalo de 1 até 500.
16+ soma = contador = 0
17+ for c in range (1 ,501 ,2 ):
18+ if c % 3 == 0 :
19+ contador = contador + 1
20+ soma = soma + c
21+ print (f'Ao todo existem { contador } números multiplos de 3 em um intervalo de 1 a 500 e sua soma é { soma } .' )
22+
23+
24+ #PT- Estruturas de repetições: For.
25+ #EN- Loop structures: For.
You can’t perform that action at this time.
0 commit comments