Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # P2PU - Python Programming 101 - Chapter 6 - Flow Control
- # Python for Informatics - Chapter 3 - Conditional Execution
- # Exercise 3.2
- print '\n# Exercise 3.2\n'
- try:
- hours = float(raw_input('Enter Hours: '))
- rate = float(raw_input('Enter Rate : '))
- pay = hours * rate
- if hours > 40 : pay = pay + (hours - 40) * rate * 0.5
- print 'Pay:', round(pay,2)
- except:
- print 'Error, please enter numeric input!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement