Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. plan = raw_input('Please input if you have plan a, b, or c: ')
  2. while True:
  3. try:
  4. hours = float(raw_input('\nHow many hours have you used on your plan: '))
  5. break
  6. except ValueError:
  7. print '\nError: Please enter a number'
  8.  
  9.  
  10. if plan == 'a':
  11. print '\nYou have plan A'
  12. if hours < 10:
  13. print 'You have used ' + str(hours) + ' and will be charged ' + str(9.95 + 2 * (hours - 10))
  14. elif plan == 'b':
  15. print '\nYou have plan B'
  16. if hours < 20:
  17. print 'You have used ' + str(hours) + ' and will be charged ' + str(13.95 + hours - 20)
  18. elif plan == 'c':
  19. print '\nYou have plan C'
  20. if hours > 20:
  21. print 'You have used ' + str(hours) + ' and will be charged 19.95'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement