mutable numbers | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

mutable numbers

Hello guys, please what are mutable numbers?

28th Jul 2019, 12:23 AM
FAROUK SHITTU
1 ответ
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)
28th Jul 2019, 12:31 AM
Steven M
Steven M - avatar