list = [1,2,3,4,7,8,10,3,2,1,5,7,8,9,10,11,10,3,2,1,5,55,67,78,89,66,67,50,40,30]result = [] for index in range(1,len(list-1)): if bigThanNext(list[index-1],list[index]): print(index) def bigThanNext(item,nextitem): sub = item-nextitem if item>=0: return true return false
Standard input is empty
Standard output is empty
Traceback (most recent call last): File "prog.py", line 4, in <module> for index in range(1,len(list-1)): TypeError: unsupported operand type(s) for -: 'list' and 'int'
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!