I have this code where it supposed to reverse a list (decided to do it in complex way instead) and I was trying to print the transpose version of the reversed list but it seem to not work out
import numpy as np
def func(n):
dictionary = {
0: 1 + 1,
1: 0
}
l = []
l.extend([n,n+1,dictionary[0] + 1])
if(l == [1,2,3]):
f = np.transpose(l)
return f[::-1]
func(1)
The output:
array([3,2,1])
What I was expecting for the output to be:
[3]
[2]
[1]