Advertisement
veronikaaa86

01. Old Books

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