1 2 3 ABC DEF GHI 4 5 6 JKL MNOPQR 7 8 9 STU VWX YZ 0 #
def decode_password(hint):
"""
##############################################################
# TODO: Replace this block of comments with your own #
# method description and add at least 3 more doctests below. #
##############################################################
>>> hint = ["Pythonia", "is", "an", "excellent", "Place"]
>>> decode_password(hint)
>>> print(hint)
[6, 3, 1, 2, 6]
>>> hint = ["great", "to", "SEE", "U", "!", "Goodbye", "."]
>>> decode_password(hint)
>>> print(hint)
[3, 7, 7, 7, 0, 3, 0]
# Add your own doctests below
"""
# YOUR CODE GOES HERE #
for x in range(len(hint)):
if hint[x][0].isalpha():
hint[x] = ord(hint[x][0].lower()) - ord('a') + 1
else:
hint[x] = 0
return


Step by step
Solved in 2 steps









