Teo_Yanchev

old_books_while

Jul 5th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. book_name = input()
  2.  
  3. sum_books = 0
  4.  
  5. while book_name != "No More Books":
  6. next_book = input()
  7. if next_book == book_name:
  8. print(f"You checked {sum_books} books and found it.")
  9. break
  10. if next_book == "No More Books":
  11. print(f"The book you search is not here!\nYou checked {sum_books} books.")
  12. break
  13. sum_books += 1
Advertisement
Add Comment
Please, Sign In to add comment