D = {'A':
[ ( '1','2' ), ( '3', '4' )],
'B':
[ ( '5','6' ), ( '7','8' ) ]
}
x = '6'
for key in D:
for val in D[key]:
if x in val:
val=('50','60')
print(D)
Hello, I want to make a change at the value of key B, but I wonder why it does not print this:
D = {'A':
[ ( '1','2' ), ( '3','4' ) ],
'B':
[ ( '50','60' ), ( '7','8' ) ]
}
How can I fix it?