a= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' n = '' res = '' key = 1 enter = input('').strip() def add (f): if f != '': f = int(f) f += key f = str(f) return f else: return n for i in enter: if a.count(i) == 0: if i.isnumeric(): n += i else: n = add(n) res += nn= '' res += i else: n = add(n) res += n n = '' res += a([(a.index(i)+key)%len(a)]) n = add(n) res += nn ='' print(res) I do not know how to fix the error in the line:
res += a([(a.index(i)+key)%len(a)]) Gives an error message:
Traceback (most recent call last): File "F:/PYCHARM PROGRAm/1/venv/Scripts/1333213213213.py", line 29, in <module> res += a([(a.index(i)+key)%len(a)]) TypeError: 'str' object is not callable PS A little of the essence of the program is Caesar's encoder. When I enter abc11, it should output bcd12. That is + 1 character / number.