Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wanted_book = input()
- counter = 0
- book = input()
- while book != 'No More Books' and book != wanted_book:
- counter += 1
- book = input()
- if wanted_book == book:
- print(f'You checked {counter} books and found it.')
- else:
- print('The book you search is not here!')
- print(f'You checked {counter} books.')
- РЕШЕНИЕ С FOR:
- import sys
- wanted_book = input()
- for i in range(sys.maxsize):
- book = input()
- if wanted_book == book:
- print(f'You checked {i} books and found it.')
- break
- elif book == 'No More Books':
- print('The book you search is not here!')
- print(f'You checked {i} books.')
- break
Add Comment
Please, Sign In to add comment