On 09/10/16 21:39, [email protected] wrote:
> Everytime I run this it says test is not defined . I don’t understand.
It means test is not defined - that is, Python doesn't know
about it. You call a function test() but there is no such
function built into Python, so it complains.
Presumably the test function is defined in a module somewhere,
in which case you need to import that function to make it
visible to python.
Can someone please help correct?
> def is_palindrome(myStr):
> if myStr in reverse(myStr):
> return True
> else:
> return False
>
> test(is_palindrome("abba"))
> test(not is_palindrome("abab"))
> test(is_palindrome("tenet"))
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor