codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#Palindrome Iterative Style. def listmaker(L): z = list(L) return z def caller(): x = raw_input('Enter the string for checking. ') L = listmaker(x) tester(L) def tester(L): count = 0 for i in range((len(L)/2)+1): if L[i] == L[-i-1] and i <= (len(L)/2): count += 1 if count == (len(L)/2): print 'Congo u ve just found a Palindrome!' else: print 'test failed!' caller()
Private
[
?
]
Run code
Submit