Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2022
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. wanted_book = input()
  2. book_counter = 0
  3. current_book = input()
  4. while current_book != 'No More Books':
  5.     if current_book == wanted_book:
  6.         print(f'You checked {book_counter} books and found it.')
  7.         quit()
  8.     book_counter += 1
  9.     current_book = input()
  10. print('The book you search is not here!')
  11. print(f'You checked {book_counter} books.')
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement