DiYane

old books 1/10

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