When does True == True

Joel Goldstick joel.goldstick at gmail.com
Thu Aug 28 16:57:40 EDT 2014


On Aug 28, 2014 4:45 PM, "Seymore4Head" <Seymore4Head at hotmail.invalid>
wrote:
>
> import math
> import random
> import sys
> pigword="Razzamattaz"
> print ("Pig Latin")
> print ("Pick a word containing only alphabetical characters",pigword)
> if len(pigword) > 0:
>     print (pigword)
> else:
>     print ("empty")
> if pigword.isalpha() == "True":
>     print (pigword)
>     print ("True")
> else:
>     print ("WTF")
> print(pigword.isalpha())
>
> What am I doing wrong?
"True" is not True
>
> pigword isalpha
> the test for true should have passed.
> The test for true din't pass even though it prints pigword.isalpha()
> True after the else statment.
> --
> https://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140828/9a390c89/attachment.html>


More information about the Python-list mailing list