I get this error? What should I do?
TypeError: descriptor 'split' requires a 'str' object but received a 'unicode', checkio, 2
From: http://www.checkio.org/mission/three-words/solve/
HTTP\_USER\_AGENT:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0
My Code:
def checkio(words):
a=str.split(words)
if len(a)>2:
for i in range (0,len(a)-2):
if (str.isalpha(a[i])and str.isalpha(a[i+1]) and str.isalpha(a[i+2]) and ( not str.isdigit(a[i]))):
return True
return False
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(u"Hello World hello") == True, "Hello"
assert checkio(u"He is 123 man") == False, "123 man"
assert checkio(u"1 2 3 4") == False, "Digits"
assert checkio(u"bla bla bla bla") == True, "Bla Bla"
assert checkio(u"Hi") == False, "Hi"
Created at: 2014/07/09 12:37; Updated at: 2014/07/09 13:39