A:
f1_urls = ['a', 'b'] f2_urls = ['a', 'c'] python3 中获取存在于f1_urls 而不在f2_urls的项目
Q:
f1_urls = ['a', 'b'] f2_urls = ['a', 'c'] # 将列表转换为集合 f1_set = set(f1_urls) f2_set = set(f2_urls) # 获取f1_set和f2_set的差集 result_set = f1_set - f2_set # 将结果转换为列表 result_list = list(result_set) print(result_list) # 输出 ['b']