Skip to content

Commit ee2c572

Browse files
author
Amogh Singhal
authored
Create isPalindrome.py
1 parent 7711b5a commit ee2c572

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

bits_wilp/isPalindrome.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
def isPalindrome(str):
2+
result = False
3+
4+
if str == str[::-1]:
5+
result = True
6+
7+
return result
8+
9+
print("Please enter a string: ")
10+
x = input()
11+
flag = isPalindrome(x)
12+
13+
if flag:
14+
print(x, "is a Palindrome")
15+
else:
16+
print(x, "is NOT a Palindrome")

0 commit comments

Comments
 (0)