I’m practicing reading and writing explanations of Python code so I better understand what in the world I’m reading. I came across the below:
orderLog = [ ]
N = 5
def get_last(position):
if position <= N and position <= len(orderLog):
return orderLog[position * -1]
There is more code following but I need some assistance understanding the last line starting with return. Am I multiplying the parameter ‘position’ by -1 and if so.. why? Also, further down I see:
Choice = -1
Again this -1 is puzzling me.