You can download this code by clicking the button below.
This code is now available for download.
Compares the ASCII code differences of corresponding characters in two strings and returns a list of these differences.
Technology Stack : Built-in functions (ord(), zip(), abs(), list comprehension)
Code Type : Function
Code Difficulty : Intermediate
def aordiff(arg1, arg2):
def ord(a):
return [ord(c) for c in a]
def diff(a, b):
return [abs(i - j) for i, j in zip(a, b)]
return diff(ord(arg1), ord(arg2))