Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- #pagesLeft.py
- #c = total pages of book.
- a = input('How many pages have you read?\n')
- b = input('How many days do you have left?\n')
- a1 = int(a)
- b1 = int(b)
- c = 1019
- d = str((c - a1) / b1)
- if d.endswith('.0'):
- e = int((c - a1) / b1)
- else:
- e = int((c - a1) / b1 + 1)
- print('''\nYou have %s days left to read %s pages:
- That is %s pages per day to finish your book.''' % (b, a, e))
- #####
- # Just some notes on float values I had to fix for my purposes.
- #245 / 18 == 43
- #245 / 18 =/= 43.0
- #800 / 18 =/= 12
- #800 / 18 =/= 12.166666666666666
- #800 / 18 == 13
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement