Update Lesson 2 Task %*f#ncA0#>? to use maketrans

This commit is contained in:
Stanislav Mykhailenko 2022-12-21 21:34:47 +02:00
parent 56d867314f
commit 507ad1caff
GPG key ID: 1E95E66A9C9D6A36

View file

@ -5,6 +5,7 @@
# Return codes: # Return codes:
# 0 - OK # 0 - OK
import codecs rot13 = str.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm')
print(codecs.encode(input("Enter message: "), "rot13")) print(input("Enter message: ").translate(rot13))