I am trying to write a short script that will convert a word or sentence into it's alphabetical value, and then jump forward 5 values, and print the result as a string. For e.g.
['a', 'b', 'c']
Should change to...
'102 103 104'
However, I only get the above error. The code in question:
def enc(input, output, seq, str_int):
input = input.lower()
output = []
for char in input:
num = ord(char) + 5
str_int = str(num)
output.append(str_int)
output = seq.join(output)
return output
print(enc("hello", [], ' ', ' '))
I'm sure I'm just missing something really obvious. Thanks.
output = seq.join(output)output to string that is why the problem occursoutput = seq.join(output)and typereturn seq.join(output)your problem is due to wrong indentation