I've returned to Python after a few years doing C code and I'm a little confused while training myself to get my Python coding habits back.
I've tried to run this little, very simple, piece of code but I keep getting a TypeError as described in the title. I've searched a lot but cannot figure out what is the problem with this :
def toLower(pStr): i = 0 for i in pStr: if ord(pStr[i]) >= 65 and ord(pStr[i]) <= 90: pStr[i] = chr(ord(pStr[i])+28) return pStr testStr = "TEST STRING" print(toLower(testStr))
i is an integer, I don't understand why I get this error. Maybe I think too much like i'm doing C IDK.