temp
variable which is assigned before sorting is also gets sorted
why?
and what is the best way to create a temporary variable for list.
>>> arr = [3, 2, 4, 1]
>>> temp = arr
>>> arr.sort()
>>> arr
[1, 2, 3, 4]
>>> temp
[1, 2, 3, 4]
whereas:
>>> a = 5
>>> b = a
>>> a
5
>>> b
5
>>> a = 1000
>>> a
1000
>>> b
5