1
I have four variables [t1, t2, T3, T4], and each of them was defined as a string previously.
t1 = 'A vida vai ficando cada vez mais dura perto do topo.'
t2 = 'A moralidade é a melhor de todas as regras para orientar a humanidade.'
t3 = 'Aquilo que se faz por amor está sempre além do bem e do mal.'
t4 = 'Torna-te aquilo que és.'
If later in the code, I want to call each of these variables at once, I thought I’d do it this way:
for i in range(1,5):
print(ti)
Thus, i would be replaced by numbers 1 to 4 and then call t1, t2, T3, T4 subsequently. Obviously, this method does not work. In fact it is possible to create a list of the texts and then do:
lista = [t1, t2, t3, t4]
for i in range(1,5):
print(lista[i])
But it becomes antipratic to create a list when the number of variables is too high. My question is: is there any way to call multiple variables previously defined at once, how it would work in the above idealized 'for' repetition?
Thanks for the help, but I rewrote my question to better express what I wanted.
– user93774