Palindrome detection: Difference between revisions
→{{header|Python}}: added Twiddle Indexing
(→{{header|Quackery}}: added inexact and twiddle indexing) |
(→{{header|Python}}: added Twiddle Indexing) |
||
Line 4,458:
'abba' -> True
'In girum imus nocte et consumimur igni' -> True</pre>
'''With Twiddle Indexing'''
I have no idea what this technique is called, so I'm going with "Twiddle Indexing".
<lang Python>def palindromic(str):
for i in range(len(str)//2):
if str[i] != str[~i]:
return(False)
return(True)</lang>
=={{header|Quackery}}==
|