Sichanov

xxxxx

Nov 29th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. searched_book = input()
  2. book_is_found = False
  3. book_counter = 0
  4. next_book = input()
  5. while next_book != "No More Books":
  6.     if next_book == searched_book:
  7.         book_is_found = True
  8.         break
  9.     book_counter += 1
  10.     next_book = input()
  11. if book_is_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