Mar-29-2019, 02:49 PM
Hello, i have a problem with for and if.
The program returns the same statement as many times as there were books entered, and i don't know what do i need to write for it to return it only one time.
The program returns the same statement as many times as there were books entered, and i don't know what do i need to write for it to return it only one time.
for i in range(len(book_name)): if book_issue_years [i] > = interval_start and book_issue_years [i] <= interval_end: print (book_name [i], book_issue_years [i]) elif book_issue_year! = interval_start and book_issue_year! = interval_end: print ("no books in that interval") #prints this statement four times, if the books were entered four times at the beginning of the code