Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plan = raw_input('Please input if you have plan a, b, or c: ')
- while True:
- try:
- hours = float(raw_input('\nHow many hours have you used on your plan: '))
- break
- except ValueError:
- print '\nError: Please enter a number'
- if plan == 'a':
- print '\nYou have plan A'
- if hours < 10:
- print 'You have used ' + str(hours) + ' and will be charged ' + str(9.95 + 2 * (hours - 10))
- elif plan == 'b':
- print '\nYou have plan B'
- if hours < 20:
- print 'You have used ' + str(hours) + ' and will be charged ' + str(13.95 + hours - 20)
- elif plan == 'c':
- print '\nYou have plan C'
- if hours > 20:
- print 'You have used ' + str(hours) + ' and will be charged 19.95'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement