0

Why lists and strings have not the same methods in Python?

11th Apr 2020, 9:59 PM
alfonsogm0
alfonsogm0 - avatar
2 ответов
+ 2
A list is a type where you store stuff in, take it out, shift it around. A str is a type to model text. Why should they have the same methods? They have totally different purposes. You might as well ask why microwaves and radios don't have the same set of buttons. (They do share a set of methods though, since they're both sequence types.)
11th Apr 2020, 10:21 PM
HonFu
HonFu - avatar