Created
September 4, 2014 15:17
-
-
Save Haylin-chama/b002f57614da8d69a9bf to your computer and use it in GitHub Desktop.
Recursividad en el control 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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