1

I want to make variables inside a for loop like this :

for i in range(1,4):
        qi = i

the answer I want is that :

q1 = 1
q2 = 2
q3 = 1

How can I do that in python ? thanks

Hamid
  • 652
  • 1
  • 7
  • 20

1 Answers1

0

It would be much easier to just use a list:

q = range(1, 4)
Mureinik
  • 277,661
  • 50
  • 283
  • 320