I did a list of x elements (a, b, c,...x,)
and I now want to turn them into variable like a = 2.
This is so I can later call them in my code by their name since I want to do some operation like a + b.
This might be the wrong way to do it but I just can't find a solution.
For those interested, I'm doing this since I want a program that can calculate the chance % of a player to win a card tournament with a line up of different decks. This is my code so far, "Listemu"
is the list I then want to turn elements into variables (like, "deck0deck01 = 60"
).
nbdeck = input("Nombre de deck :")
nbdeck = int(nbdeck)
i = 0
Listedeck=[]
while i < nbdeck :
Listedeck.append('deck'+str(i))
i += 1
i = 0
a = 0
Listemu=[]
for elt in Listedeck :
while i < nbdeck :
Listemu.append('deck'+str(a)+'deck'+str(i))
i += 1
a += 1
i = 0
Here I want to insert every % of two decks match up like deck0
against deck1 = 60%
for deck0
(created in Listemu
under "deck0deck1"
name) to call the % when I simulate the confrontation.