# stores the modified string representation of a digit
digitStringDict={" _ | ||_|":"0"," | |":"1"," _ _||_ ":"2"," _ _| _|":"3"," |_| |":"4"," _ |_ _|":"5"," _ |_ |_|":"6"," _ | |":"7"," _ |_||_|":"8"," _ |_| _|":"9"}# takes a multiline string as input
# outputs the int representation of that
defstringToAccountNumber(account:str)->int:account=account.strip("\n")parts=account.split("\n")# split the actual string into three strings based on new-line character
numberStr=""# stores the string representation of the number
foriinrange(0,len(parts[0]),3):numberStr+=digitStringDict[parts[0][i:i+3]+parts[1][i:i+3]+parts[2][i:i+3]]returnint(numberStr)
Python solution
Output,