-1
Was Doubtful in an exercise resolution in Python.
pri_termo = int(input('Digite o primeiro Termo: '))
razao = int(input('Digite a Razão da PA: '))
termo = pri_termo
cont = 1
while cont <= 10:
print('{} --> '.format(termo), end='')
termo += razao
cont += 1
My real doubt is that the 'term' corresponds to the 'pri_term', where the two would have the same value? Thank you in advance.
Well, that’s a very specific question and I think it’s outside the scope of the site. But note that this occurred only because the name used within the loop is
termo
. It would be possible to use only the namepri_termo
, but to do so would need to change the name of the variable within the loop– Lucas
It makes sense if, for whatever reason, you want to preserve the value of
pri_termo
. If there is no such need then you can use only one variable.– anonimo