Untitled
unknown
python
3 years ago
325 B
4
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))Editor is loading...