BbJLeB

01. Old Books

May 13th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # 01. Old Books
  2. title = input()
  3. capacity = int(input())
  4.  
  5. text = ""
  6. counter = 0
  7. found = False
  8.  
  9. while capacity > counter:
  10.     text = input()
  11.     if text == title:
  12.         found = True
  13.         break
  14.     else:
  15.         counter += 1
  16.  
  17. if found:
  18.     print(f"You checked {counter} books and found it.")
  19. else:
  20.     print("The book you search is not here!")
  21.     print(f"You checked {counter} books.")
Advertisement
Add Comment
Please, Sign In to add comment