I am relatively new to python and I have searched the web for an answer but I can't find one.
The program below asks the user for a number of inputs, and then asks them to input a list of integers of length equal to that of the number of inputs.
Then the program iterates through the list, and if the number is less than the ToyValue, and is less than the next item in the list the variable ToyValue increments by one.
NoOfToys=0
ToyValue=0
NumOfTimes=int(input("Please enter No of inputs"))
NumberList=input("Please enter Input")
NumberList=NumberList.split(" ")
print(NumberList)
for i in NumberList:
    if int(i)>ToyValue:
        ToyValue=int(i)
    elif int(i)<ToyValue:
        if int(i)<int(i[i+1]):
            NoOfToys=NoOfVallys+1
            ToyValue=int(i[i+1])
    else:
        pass
print(NoOfVallys)
Here is an example of some data and the expected output.
#Inputs
8
4 6 8 2 8 4 7 2
#Output
2
I believe I am having trouble with the line i[i+1], as I cannot get the next item in the list
I have looked at the command next() yet I don't think that it helps me in this situation.
Any help is appreciated!

for i in NumberList:iterates through the "items" of the list. this means thaticontains the values of the list, not indexes. thusi[i+1]doesn't work. Check out enumerate if you want to work on indexes.NumberList = [int(num) for num in NumberList.split(" ")].