Advertisement
horozov86

01. Old Books

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