0
mutable numbers
Hello guys, please what are mutable numbers?
1 Odpowiedź
0
Mutable means changeable, so lists and dictionaries are the first objects that come to mind, with regards to python. Basically, you can add to and take from. However, tuples are immutable and cannot be changed, but what about a list object inside a tuple?... A mutable object inside an immutable object? Well, you can update those too.
x=[]
for each in range(1,11):
x.append(each)
print(x)
y=([],6,7)
for each in range(1,6):
y[0].append(each)
print(y)