Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

difference between sort and sorted

#sort vs sorted
#sorted(sequence)
'''sorted() method  arrenges sequence either in ascending order or in
descending order also it can return the sorted sequence,with no problem
to original sequence .'''
# list.sort()
'''sort() function is identical to sorted, unlike sorted it do not return
and only applicable as method of list and only used with and by list.
unlike sorted() it alters original sequence.'''

 
PREVIOUS NEXT
Tagged: #difference #sort #sorted
ADD COMMENT
Topic
Name
4+5 =