0

Why the result doesn't give {8,9,7}, Set always give the values in their own order...

https://sololearn.com/compiler-playground/c03kCSDRtRdr/?ref=app

15th Feb 2024, 1:22 PM
Theo Martier
Theo Martier - avatar
3 Respostas
+ 2
""" Theo Martier , The official docs on set: https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset You can also do it this way. """ first = {1, 2, 3, 4, 5, 6} second = {4, 5, 6, 7, 8, 9} print(sorted(list(second - first))) # [7, 8, 9]
15th Feb 2024, 10:26 PM
Rain
Rain - avatar
+ 1
Thank you , NB and Rain 👍
16th Feb 2024, 11:16 AM
Theo Martier
Theo Martier - avatar