Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def user_input():
- '''Take input from user,return a tuple'''
- while True:
- try:
- houer_pay = float(raw_input('How much is the houerly payment'))
- work_houers = float(raw_input('How many houers did she work'))
- tax = float(raw_input('How many % did she pay in taxes'))
- return houer_pay, work_houers, tax
- except ValueError:
- print 'Only numbers as input,try again'
- def calculate(user_input):
- '''Caculate gross salary'''
- houer_pay, work_houers, tax = user_input
- return houer_pay * work_houers * (1-(tax/100))
- if __name__ == '__main__':
- print calculate(user_input())
- help(calculate) #When we use docstring in function help works
Advertisement
Add Comment
Please, Sign In to add comment