+ 5
list({3,2,1}) == [1,2,3] :True
(From a challenge) We know order is a meaningless concept for sets. I think this behavior (sorting before converting to list) is not a rule. Although it seems to always happens for numbers (not for characters). What do you guys think?
4 ответов
+ 2
Hi Arsalan!
No, it's the same for characters since set stores the elements in a random manner.
We can see that here.
https://code.sololearn.com/c62I3TyzNjzv/?ref=app
+ 1
As I know, we can write a list element with using both { } and [ ] so the given is true.