Solving a common interview question: How do you determine if a string is a palindrome?
Answer: str=input("Enter:") reverse=str[::-1] if str == reverse: print("Palindrome") else: print("Not Palindrome")
Determine if a string is a palindrome in Python
Solving a common interview question: How do you determine if a string is a palindrome?
Answer: str=input("Enter:") reverse=str[::-1] if str == reverse: print("Palindrome") else: print("Not Palindrome")
Leave feedback in the comments!
Log in or sign up for Devpost to join the conversation.