Click here to Skip to main content
16,016,537 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: How can i read or get an XML from another host? Pin
spawneditions5-Apr-10 9:15
spawneditions5-Apr-10 9:15 
Questionproblem assistance Pin
nanjekye joannah22-Mar-10 8:28
sussnanjekye joannah22-Mar-10 8:28 
AnswerRe: problem assistance Pin
rastaVnuce22-Mar-10 8:36
rastaVnuce22-Mar-10 8:36 
AnswerRe: problem assistance Pin
yiangos29-Apr-10 9:46
professionalyiangos29-Apr-10 9:46 
AnswerRe: problem assistance Pin
Stephen Hewitt10-Jun-10 21:52
Stephen Hewitt10-Jun-10 21:52 
GeneralRe: problem assistance Pin
DaveDn24-Nov-10 5:58
DaveDn24-Nov-10 5:58 
GeneralRe: problem assistance Pin
DaveDn27-Nov-10 23:27
DaveDn27-Nov-10 23:27 
GeneralRe: problem assistance [modified] Pin
Keith.Badeau22-Feb-11 12:49
Keith.Badeau22-Feb-11 12:49 
I'm new to Python and string objects. I can manipulate them but this trick is really cool. This is what I through together using recursion real quick:
def isPalindrome(str):
    """Parses string and tests if palindromic; Returns True or False"""
    if len(str) <= 1:
        return True;
    if str[0] != str[-1]:
        return False
    return isPalindrome(str[1:-1])


But using your simpler method:
def isPal(str):
    return str == str[::-1]


Thanks a lot for that post!

modified on Thursday, February 24, 2011 11:55 AM

QuestionPERL reading .sql file? Pin
josephong21-Mar-10 23:07
josephong21-Mar-10 23:07 
AnswerRe: PERL reading .sql file? Pin
jschell6-Apr-10 10:56
jschell6-Apr-10 10:56 
QuestionDjango trouble Pin
rastaVnuce20-Mar-10 23:57
rastaVnuce20-Mar-10 23:57 
AnswerRe: Django trouble Pin
Chris Austin23-Mar-10 4:28
Chris Austin23-Mar-10 4:28 
GeneralRe: Django trouble Pin
rastaVnuce23-Mar-10 4:41
rastaVnuce23-Mar-10 4:41 
GeneralRe: Django trouble Pin
Chris Austin23-Mar-10 4:47
Chris Austin23-Mar-10 4:47 
GeneralRe: Django trouble Pin
rastaVnuce23-Mar-10 5:00
rastaVnuce23-Mar-10 5:00 
Questioninfinite loop while using php's dir object..? Pin
cjoki19-Mar-10 11:31
cjoki19-Mar-10 11:31 
AnswerRe: infinite loop while using php's dir object..? Pin
chevu28-Mar-10 23:28
chevu28-Mar-10 23:28 
GeneralRe: infinite loop while using php's dir object..? Pin
cjoki29-Mar-10 4:53
cjoki29-Mar-10 4:53 
GeneralRe: infinite loop while using php's dir object..? Pin
chevu29-Mar-10 19:04
chevu29-Mar-10 19:04 
Questionquery help with table that has no primary keys Pin
scorpio2219-Mar-10 10:26
scorpio2219-Mar-10 10:26 
AnswerRe: query help with table that has no primary keys Pin
PHP_Guy22-Mar-10 11:01
PHP_Guy22-Mar-10 11:01 
QuestionCreating project setup Pin
sarang_k17-Mar-10 18:36
sarang_k17-Mar-10 18:36 
AnswerRe: Creating project setup Pin
PHP_Guy19-Mar-10 7:24
PHP_Guy19-Mar-10 7:24 
QuestionExporting HTML file to PDF format Pin
sarang_k11-Mar-10 22:47
sarang_k11-Mar-10 22:47 
AnswerRe: Exporting HTML file to PDF format Pin
Niall Barr11-Mar-10 23:07
professionalNiall Barr11-Mar-10 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.