0

a1 = 1
a2 = 2
a3 = 3
.......
a10000 = 10000

So, I want to create a function that will autoassign names to numbers. In the the code above,

for x in range (desired range):
    a(quantity of x) = x

how do i get my code to call the quatity of x?

Edited by bnn678

6
Contributors
6
Replies
58
Views
3 Years
Discussion Span
Last Post by Gribouillis
0

I need it for a code such as this:

row0 = ['3']
row1 = ['7', '4']
row2 = ['2', '4', '6']
row3 = ['8', '5', '9', '3']

for x in range(4):
    nextNum = locals()['row' + str(x)]

Edited by bnn678

0

I need it for a code such as this:

No that just stupid code.
Explain better what you want do,then you get suggestions for better ways to solve it.

Edited by snippsat

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.