[Tutor] Python Code Not Working

D.V.N.Sarma డి.వి.ఎన్.శర్మ dvnsarma at gmail.com
Wed Oct 12 00:25:14 EDT 2016


An easier solution is simply to type 'print' in place of 'test' in the
program. It will work.
regards,
Sarma.


On Mon, Oct 10, 2016 at 2:09 AM,  <jeremygainey14 at gmail.com> wrote:
> Everytime I run this it says test is not defined . I don’t understand. Can someone please help correct?
>
> #Question 10
>
> def reverse(mystr):
>     reversed = ''
>     for char in mystr:
>         reversed = char + reversed
>     return reversed
>
> 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"))
> test(not is_palindrome("banana"))
> test(is_palindrome("straw warts"))
> test(is_palindrome("a"))
> test(is_palindrome(""))
>
> -Jeremy Gainey
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list