Sichanov

old books

Jun 15th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. searched_book = input()
  2. book = input()
  3. book_counter = 0
  4. book_found = False
  5. while book != "No More Books":
  6.     if searched_book == book:
  7.         book_found = True
  8.         break
  9.     book_counter += 1
  10.     book = input()
  11. if book_found:
  12.     print(f"You checked {book_counter} books and found it.")
  13. else:
  14.     print("The book you search is not here!")
  15.     print(f"You checked {book_counter} books.")
  16.  
Advertisement
Add Comment
Please, Sign In to add comment