Relative Content

Tag Archive for pythonlistmathrandomrandom-seed

Function to find correct element in this list

I have a list of 16 randomly generated values i.e.[-1, -1, 1, 8, -5, 5, 8, -7, -4, 2, -5, 14, -1, -13, -4, -6]. So the values in this list are randomly generated from different functions which have different seed values thus they are not related statistically. *The seeds are not important in finding the solution. The issue here lies in selecting the correct value which will be used in selecting the correct speed of a car with a negative value indicating the car is reversing and positive value indicating forward movement so is there a function that can be employed to find the correct movement of the vehicle i.e. forward or backward. *The magnitude of the value does not matter.