
Untitled
By: a guest on
May 10th, 2012 | syntax:
Python | size: 0.37 KB | hits: 39 | expires: Never
#!/usr/bin/python
# P2PU - Python Programming 101 - Chapter 6 - Flow Control
# Python for Informatics - Chapter 3 - Conditional Execution
# Exercise 3.1
print '\n# Exercise 3.1\n'
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)