I'm having a problem in my code where I'm trying to check if (in my case) there is a review already created with that title from that reviewer.
For that I'm doing:
def review_result(self):
print("Complete your review")
title = input("Title of the paper: ")
reviewer = input("Reviewer's name: ")
for x in self.__review:
if x == title:
index = self.__review.index(x)
if self.__review[index + 1] == reviewer:
But in my self.__review
list I can have the same title repeated multiple times but all with diferent reviewers, for example: ['Book1', 'Rev1', 'Book1', 'Rev2', 'Book1' Rev3']
When I have 2 reviews from the same paper I can't access the 2nd review because that for x in self.__review
is only searching for the 1st value that apears.
Is there any way I can see the next 'x' in that for x in self.__review
loop?