below is my code, and when I print or use the Python set, it automatically re-sort my item, why does this happen?
a = {9,40,49}
print(a)
{40, 9, 49}
Below is notebook printed image.
below is my code, and when I print or use the Python set, it automatically re-sort my item, why does this happen?
a = {9,40,49}
print(a)
{40, 9, 49}
Below is notebook printed image.
Sets are an unordered data structure. However, depending on your use case, it might be appropriate to use a different data type such as list.