File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1- #61- Redo CHALLENGE 51, reading the first term and the reason of an AP,
2- showing the first 10 terms of the progression
1+ #EN- Loop structure: While
2+ #Arithmetic Progression v2.0
3+ #61- Redo CHALLENGE 51, reading the first term and the reason of an AP,showing the first 10 terms of the progression
34# using the while structure.
45print ("Arithmetic progression generator" )
56print ("-=-" * 20 )
1213 term += reason
1314 counter += 1
1415print ("End" )
16+
17+ #PT- Estruturas de repetição: While.
18+ #Progressão Aritmética v2.0
19+ #61: Refaça o DESAFIO 51, lendo o primeiro termo e a razão de uma PA, mostrando os 10 primeiros termos da progressão
20+ # usando a estrutura while.
21+ primeiro_termo = int (input ('Digite o primeiro valor:' ))
22+ razao = int (input ('Qual a razão da PA?' ))
23+ termo = primeiro_termo
24+ contador = 1
25+ while contador <= 10 :
26+ print (f'{ termo } ' , end = ' ' )
27+ termo += razao
28+ contador += 1
29+
You can’t perform that action at this time.
0 commit comments