when I sort this list -> y = [20, 10 ,20]
y = sorted(y, key = y.count)
# y -> [10, 20, 20]
y.sort(key = y.count)
# y -> [20, 10, 20]
why do both functions give different results?
when I sort this list -> y = [20, 10 ,20]
y = sorted(y, key = y.count)
# y -> [10, 20, 20]
y.sort(key = y.count)
# y -> [20, 10, 20]
why do both functions give different results?