When does True == True

Seymore4Head Seymore4Head at Hotmail.invalid
Thu Aug 28 16:38:13 EDT 2014


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?

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.



More information about the Python-list mailing list