File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ #Arithmetic Progression
12#51-Develop a program that reads the first term and the ratio of an AP. At the end, show the first 10 terms
23# of this progression.
34first = int (input ('First term:' ))
45ratio = int (input ('Ratio:' ))
5- tenth = first + (10 - 1 ) * ratio
6+ tenth = first + (10 - 1 ) * ratio
67for c in range (first ,tenth + ratio , ratio ):
78 print (f'{ c } ' , end = ' -> ' )
89print ('He finished' )
10+
11+
12+ #Progressão Aritmética
13+ # 51: Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final, mostre os 10 primeiros termos
14+ # dessa progressão.
15+ primeiro = int (input ('Digite o primeiro termo da PA:' ))
16+ razao = int (input ('Digite a razão da PA:' ))
17+ dez = primeiro + (10 - 1 ) * razao
18+ for contador in range (primeiro , dez + razao , razao ):
19+ print (f'{ contador } ' , end = '-' )
20+ print ('Fim' )
21+
22+
23+ #PT- Estruturas de repetições: For.
24+ #EN- Loop structures: For.
You can’t perform that action at this time.
0 commit comments