The idea is the user will be able to extract a certain row under a certain condition. The condition is to return the last 'Pass' encountered before fail. For example, the user inserts the value 5, the if statement should print out 3. As this is the last time he passed. if the user would insert 0, it would also return 3, as this is the last time he passed before he failed.
So basically the idea is to return the last pass encountered before he failed. Another example on the same dataset, if the user passes 7, it would return 7. As this is the last 'pass' before he failed.
---------------------------
#dataSet
Index Result
0 Pass
1 Pass
2 Pass
3 Pass
4 Fail
5 Fail
6 Pass
7 Pass
8 Fail
---------------------------
result = 'Result'
if df.loc[index_value,result] == 'Pass':
else: