Bonjour,
J ai un gros pobleme ou je ne comprend plus rien
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| ############# jepenseARGENT #############
##### DONNEE #####
profondeur = 2
nombredecase = 9
##### DONNEE #####
jepenseARGENT = [[0]]
b = 0
while b < profondeur:
b = b+1
jepenseARGENT.append([])
vappend = 0
c = 0
while c < profondeur:
c = c+1
b = 0
while b < nombredecase+1:
b = b+1
jepenseARGENT[c].append(vappend)
vappend = jepenseARGENT[c]
############# jepenseARGENT ############# |
Bon ensuite je lui dit de printer la variable jepenseARGENT
Parfait sa me donne sa
[[0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]
Maintenant je veux que jepenseARGENT[2][2][2] soi egale a "test"
jepenseARGENT[2][2][2] = "test"
Je printe la variable jepenseARGENT
Mais sa me donne sa
[[0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [[0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0], [0, 0, 'test', 0, 0, 0, 0, 0, 0, 0]]]
Aider moi
Partager