Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- book = input()
- capacity = int(input())
- checked = 0
- next_book = input()
- is_found = False
- while checked <= capacity:
- if next_book == book:
- is_found = True
- break
- checked += 1
- if checked == capacity:
- break
- next_book = input()
- print(f"You checked {checked} books and found it."
- if is_found == True else f"The book you search is not here!\nYou checked {capacity} books.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement