def sumaimpm(numeroin,numerofin):
sumaimp=0
while numeroin>=numerofin:
residuo=numeroin%2
if residuo!=0:
sumaimp=sumaimp+numeroin
numeroin=numeroin-1
print "Suma de impares: ",sumaimp
numeroin=int(input("Dame el numero inicial: "))
numerofin=int(input("Dame el numero final: "))
sumaimpm(numeroin,numerofin
No hay comentarios:
Publicar un comentario