Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.