Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to print palindrome number from 1 to n in python

n = int(input())
if n < 100:
    for i in range(1, n+1):
        s = str(i)
        if s == s[::-1]:
            print(i)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #print #palindrome #number #python
ADD COMMENT
Topic
Name
4+6 =