Untitled

 avatar
unknown
python
2 years ago
325 B
0
Indexable
str = input("Input string: ")
offset = int(input("Input offset number: "))

result = ''
for c in str:
	result = result + (chr(ord(c) + offset) if c.isalpha() else c)
print("Result classic: ", result)

result_symbols = [chr(ord(c) + offset) if c.isalpha() else c for c in str]
print("Result modern: ", ''.join(result_symbols))