호그와트

rot13

영웅*^%&$ 2023. 6. 20. 12:06
728x90

# ROT13 reference

import codecs

def rot13(secret):

"""ROT13 encode/decode

NOTE: encode and decode are the same operation in the ROT cipher family.

"""

return codecs.encode(secret, 'rot_13')

def choose_longest():

"""Echo the longest of the two strings given by the user to the program

"""

user_value_1 = input("What's your first string? ")

user_value_2 = input("What's your second string? ")

longest_value = user_value_1 if len(user_value_1) >= len(user_value_2) else user_value_2

print("The longest string is: " + longest_value)

# Test the functions

print(rot13("Hello, World!"))

choose_longest()

728x90

'호그와트' 카테고리의 다른 글

해킹 해킹 바운스~ 바운스~  (0) 2023.06.23
주식 주식 바운스~ 바운스~  (0) 2023.06.20
퓨어 알티지 DHA 오메가 3  (0) 2023.06.18
쥐를 잡아 미키마우스  (0) 2023.06.16
파벳이 울트라고기 구워 먹을 때  (0) 2023.06.12