Skip to content

Commit da6b7bc

Browse files
committed
doc: add comments
Loop structure: While. Arithmetic progression v2.0
1 parent 6ad64cc commit da6b7bc

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

ex061.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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.
45
print("Arithmetic progression generator")
56
print("-=-" * 20)
@@ -12,3 +13,17 @@
1213
term += reason
1314
counter += 1
1415
print("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+

0 commit comments

Comments
 (0)