pikhoo / pythonBOT

BOT
0 stars 1 forks source link

a function is not JSON serializable #1

Open pikhoo opened 6 years ago

pikhoo commented 6 years ago

numberOfwords is a simple function to count the number of letters in a given string

def numberOfawords():
    string = "you can put your string here"
    for i in range(0, len(string)):
        if sWord[i]=="s":
            count+=1
            word=string[i]
        return count+word

here is the error after calling the numberOfawords function

TypeError: <function numberOfawords at 0x7f2229daa9b0> is not JSON serializable

any suggestion

pikhoo commented 6 years ago

I have found the problem

regards