Python 我试图打印出字符串及其各自的分数

Python 我试图打印出字符串及其各自的分数,python,Python,我取了两个字符串列表,并取了两个列表的笛卡尔积,然后生成一个分数(模糊匹配)。但是,当我希望字符串对与分数一起打印时,我只能得到要返回的每对字符串的分数。有什么想法吗 #convert the datadrame into a list my_list1 = address['Street'].tolist() my_list2 = address['Street'].tolist() 为了保持问题的清晰性,我不会显示进行模糊匹配比较的函数,但我会显示调用函数的代码,并显示输出 #Assig

我取了两个字符串列表,并取了两个列表的笛卡尔积,然后生成一个分数(模糊匹配)。但是,当我希望字符串对与分数一起打印时,我只能得到要返回的每对字符串的分数。有什么想法吗

#convert the datadrame into  a list
my_list1 = address['Street'].tolist()
my_list2 = address['Street'].tolist()
为了保持问题的清晰性,我不会显示进行模糊匹配比较的函数,但我会显示调用函数的代码,并显示输出

#Assign your list1
Test_addrs = my_list1
#Assign your List2 and build the nested loop
target_addr = my_list2
for addr in Test_addrs:
    for target in target_addr:
        distance = string_match(target, addr, ratio_calc = True)
        #print the scores
        print(distance)

Output:
100.0
35.9
41.18
如何让这对字符串沿着这些分数打印

print (f'Address: {addr}, Target: {target}, Distance: {distance}')
有关如何在Python3.6及更高版本中使用f字符串文字的详细信息:

打印(目标、地址、距离)
?哇。我想我以为这会在得到两个字符串的乘积之前打印出两个列表。非常感谢。