#!/usr/bin/python
# -*- coding: utf-8 -*-
def calculo_salario(horas, tarifa):
if (horas > 40):
horas_extra = horas - 40
salario = 40*tarifa + horas_extra*tarifa*1.5
else:
salario = horas*tarifa;
return salario
try:
horas = float(raw_input('Introduce las horas? '))
tarifa = float(raw_input('Tarifa por horas? '))
print 'Salario %.2f ' %calculo_salario(horas,tarifa)
except:
print "Error, introduzca un número"
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.