it generated a new object, did not change the original. hint: notice the output is a list, not a tuple!
On August 2, 2017 1:01:31 PM MDT, C W <tmrs...@gmail.com> wrote: >Dear list, > >I am a little confused about why Tuple can be sorted. > >Suppose I have the following, > >> aTuple = (9, 3, 7, 5) >> sorted(aTuple) >[3, 5, 7, 9] > >Why is it ok to sort a the class tuple? If it is invariant by nature, >then >wouldn't applying a function on it yield an error? > >Thanks! >_______________________________________________ >Tutor maillist - Tutor@python.org >To unsubscribe or change subscription options: >https://mail.python.org/mailman/listinfo/tutor -- Sent from my Android device with K-9 Mail. Please excuse my brevity. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor