我正在使用API从使用两个不同指标的两个不同URL接收数据。当我创建两个for循环时,我开始接收想要的数据,但是后来我意识到我正在获取数据的重复项,我认为这是因为我有多个for循环。我认为将它们组合为一个for循环可能会解决问题,但我不知道如何。有什么建议吗?
for ticket1 in ticket_list1:
for ticket2 in ticket_list2:
times = ticket2['reply_time_in_minutes']
ticket_id = ticket2['ticket_id']
assignee = ticket1['assignee_id']
priority = ticket1['priority']
if ticket1['assignee_id'] != ticket1['requester_id']:
if times['calendar'] != None:
if priority != None:
print("%s %20s %20s %20s" % (times, ticket_id,
assignee, priority))
答案 0 :(得分:1)