“Python Palindrome String” Ответ

Как напечатать палиндром в 100 между 250 в питоне

>>> def isPalindrome(s):
    ''' check if a number is a Palindrome '''
    s = str(s)
    return s == s[::-1]

>>> def generate_palindrome(minx,maxx):
    ''' return a list of Palindrome number in a given range '''
    tmpList = []
    for i in range(minx,maxx+1):
        if isPalindrome(i):
            tmpList.append(i)

    return tmpList

>>> generate_palindrome(1,120)

[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111]
Disgusted Dingo

Python Palindrome

def palindrome(a):
    return a == a[::-1]

palindrome('radar') 		# True
VasteMonde

Палиндром Слова Python

mes=input("Enter the word and see if it is palindrome ")
if mes==mes[::-1]:
    print("This word is palindrome")
else:
    print("This word is not palindrome")
Zany Zebra

Python Palindrome String

s = "001100"

if s == s[::-1]:
    print("palindrome string")
else:
    print("Not a palindrome string.")
Excited Earthworm

Функция палиндрома Python

bilangan = (5 % 3 ** 2) + (3 + 2 * 2) * (4 - 2) 
print(bilangan)
Shy Squirrel

Ответы похожие на “Python Palindrome String”

Вопросы похожие на “Python Palindrome String”

Больше похожих ответов на “Python Palindrome String” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования