+ 2
(List and Set) to Tuple anomaly?
** input *** a = [3,8] b = {3,8} print(tuple(a)) print(tuple(b)) *** output *** (3, 8) (8, 3) why???
4 Answers
+ 12
in addition to what Mark foxx said sets don't retain the order of the values like dictionaries, their elements are therefore not callable by their index I.e (b[index])
+ 7
You've printed it as a tuple, and you're not changing the original values neither of a, or b - remaining the same.
+ 2
thnx to all
+ 1
But (3,8) != (8,3)