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