Quick actions

cmd+k|ctrl+k

Navigation

Languages

GiaDieu_pymihcm1708_ex3_8

Snippet info

Language

Python

Visibility

public

Author

giadieuly

Created

2017-08-12T19:43:56Z

Updated

2017-08-12T19:43:56Z

def solve(text):
    text = text.lower()
    text = text.replace(' ','')
    if text[0:] == text[::-1]:
        return'this sentence is palindrome!'
    else:
        return 'this sentence is not palindrome'

print(solve('Able was I ere I saw Elba'))
print(solve('civic'))
print(solve('Nurses run'))
print(solve('Race Car'))
INFO