what are mutable and immutable object explain with example of tuples and list in python????and yes how to arrange list in accending order
Answers
Answered by
3
mutable object are those which could be changed or which can be reset..while immutable cannot be changed ya list is mutable object as we can edit its value while this could not be happen in tuple they are just set as default by their own ...
let take any list say l=[1,2,3,4,5,6]
to arrange in ascending order
l.sort()
and to write in descending order
l.reverse()
let take any list say l=[1,2,3,4,5,6]
to arrange in ascending order
l.sort()
and to write in descending order
l.reverse()
Answered by
2
mutable object are those which could be changed or which can be reset..while immutable cannot be changed ya list is mutable object as we can edit its value while this could not be happen in tuple they are just set as default by their own ...
let take any list say l=[1,2,3,4,5,6]
to arrange in ascending order
l.sort()
and to write in descending order
l.reverse()
let take any list say l=[1,2,3,4,5,6]
to arrange in ascending order
l.sort()
and to write in descending order
l.reverse()
Similar questions
English,
8 months ago
Computer Science,
8 months ago
Hindi,
1 year ago
Math,
1 year ago
Biology,
1 year ago