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,
2 months ago
Social Sciences,
2 months ago
English,
2 months ago
Math,
6 months ago
Computer Science,
6 months ago
Science,
11 months ago
CBSE BOARD XII,
11 months ago
Hindi,
11 months ago