dic = {
'A':'10', 'J':'18', 'S':'26',
'B':'11', 'K':'19', 'T':'27',
'C':'12', 'L':'20', 'U':'28',
'D':'13', 'M':'21', 'V':'29',
'E':'14', 'N':'22', 'W':'32',
'F':'15', 'O':'35', 'X':'30',
'G':'16', 'P':'23', 'Y':'31',
'H':'17', 'Q':'24', 'Z':'33',
'I':'34', 'R':'25'
}
for x in dic:
value = dic.get(x)
value_num = int(value)
value_num_one = value_num//10
value_num_two = value_num%10
total = value_num_one + (value_num_two*9) # 從字典遍歷每個字母,將其值檢查是否對應上面計算的檢查碼
if total%10 == check_num:
list.append(x)
list.sort() # 加入列表並且按字母順序排列
if list:
print(''.join(list)) # 以值的型態印出
elif s%10 == 0:
print('BNZ') # 這邊偷用板上大大們的速解,和的值除以10的餘數為0,則直接印出,希望這邊能提供有沒這麼暴力的寫法