Donate SIGN UP

Python (Palindrome Checker)

Avatar Image
Goodsoulette | 16:56 Sat 22nd Jun 2013 | Technology
4 Answers
http://cscircles.cemc.uwaterloo.ca/13-lists/

On the Palindromes exercise, could some kind soul tell me how to get foolproof to return as false :D Not getting it right :/
Gravatar

Answers

1 to 4 of 4rss feed

Avatar Image
I don't know what language this is Goodsy, but, in general terms.... I guess you could start by returning the length of the string. LEN [S] ? Then write a loop to compare S[0] with S[length-1] Then compare S[1] with S[length-2] etc etc If all are equal, then return TRUE.
17:59 Sat 22nd Jun 2013
I don't know what language this is Goodsy, but, in general terms....

I guess you could start by returning the length of the string.
LEN [S] ?

Then write a loop to compare S[0] with S[length-1]
Then compare S[1] with S[length-2]
etc
etc
If all are equal, then return TRUE.
sorry, missed that it's Python :o(
Question Author
Thank you lovely xx
-- answer removed --

1 to 4 of 4rss feed

Do you know the answer?

Python (Palindrome Checker)

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.