Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ef6a67

Browse filesBrowse files
authored
Fixed case sensitivity bug (#65)
Fixed case sensitivity bug
2 parents 3505967 + 377dbf1 commit 1ef6a67
Copy full SHA for 1ef6a67

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎strings/palindrome.py

Copy file name to clipboardExpand all lines: strings/palindrome.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ def reverse(s):
33
return s[::-1]
44

55
def isPalindrome(s):
6+
# Convert s to uppercase to ignore case sensitivity
7+
s = s.upper()
68
# Checking if both string are equal or not
79
if (s == reverse(s)):
810
return True
911
return False
1012

1113
# Tests
12-
print(isPalindrome('racecar'))
14+
print(isPalindrome('Racecar'))
1315
print(isPalindrome('ferrari'))
14-
print(isPalindrome('civic'))
16+
print(isPalindrome('CiVIc'))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.