write a program to get a string in uppercase from user and show only the palindrome words from the string
Answers
Answered by
1
s = input("enter string: ").split()
palindromes = [word for word in s if word == word[::-1]]
print("\n".join(palindromes))
Answered by
1
s = input("enter string: ").split()
palindromes = [word for word in s if word == word[::-1]]
print("\n".join(palindromes))
Similar questions
Math,
1 month ago
Math,
1 month ago
Science,
1 month ago
Math,
3 months ago
Computer Science,
3 months ago
Science,
9 months ago
CBSE BOARD XII,
9 months ago
Hindi,
9 months ago