I'm new with python and I really cannot find a way to do this.
I want to change the letters of a string based on some criteria. Here is the code:
for c in text:
ordChar=ord(c)
if ordChar>=65 and ordChar<=90:
ordChar=ordChar+13
if ordChar>90:
ordChar=ordChar-90+64
c=chr(ordChar)
else:
if ordChar>=97 and ordChar<=122:
ordChar=ordChar+13
if ordChar>122:
ordChar=ordChar-122+96
c=chr(ordChar)
return text
The returned text
value is the same as the parameter value. I thought variables were pointers, so editing c
, it should edit text
. What am I doing wrong?