Skip to content

Instantly share code, notes, and snippets.

@Haylin-chama
Created September 4, 2014 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Haylin-chama/b002f57614da8d69a9bf to your computer and use it in GitHub Desktop.
Save Haylin-chama/b002f57614da8d69a9bf to your computer and use it in GitHub Desktop.
Recursividad en el control 2
def CantCuSe(a,b,c):
if a<=b:
if int(a)%10==4 or a%10==6:
c=c+1
CantCuSe(int(a)+1,b,c)
else:
print "Cantidad de numeros que terminan en 4 o 6: ",c
def main():
c=0
a=input("Ingresa a: ")
b=input("Ingrese b: ")
if a>b:
CantCuSe(b,a,c)
else:
CantCuSe(a,b,c)
if __name__=="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment