-
-
Save adaltamirano/7a548a038615bf13b40adaae9cab49a7 to your computer and use it in GitHub Desktop.
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
#Intervalo inferior | |
a=10 | |
#Intervalo superior | |
b=454657 | |
#Contador para la cantidad de capicuas | |
c=0 | |
print("Los capicuas encontrados son los siguientes:") | |
for i in range(a,b+1): | |
num_s=str(i) | |
num_list=list(num_s) | |
if num_list==num_list[::-1]: | |
cap=''.join(num_list) | |
c+=1 | |
print(cap) | |
print("Total de Capicuas:",c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment