Here is my code:
my_list=[2794, 2798, 2817, 2820, 2821, 2823, 2824, 2826, 2829, 2831, 2831, 2831, 2839, 2842, 2843, 2845, 2847, 2850, 2851, 2854, 2855, 2856, 2857, 2858, 2859, 2862, 2864, 2865]
for i in my_list:
print(i)
print("\n\n")
my_set = set(my_list)
for i in my_set:
print(i)
output:
2794
2798
2817
2820
2821
2823
2824
2826
2829
2831
2831
2831
2839
2842
2843
2845
2847
2850
2851
2854
2855
2856
2857
2858
2859
2862
2864
2865
2817
2820
2821
2823
2824
2826
2829
2831
2839
2842
2843
2845
2847
2850
2851
2854
2855
2856
2857
2858
2859
2862
2864
2865
2794
2798
Question: Why list (in ascending) and set (in some other) are printed in different order?