阅读背景:

如何将映射到字典中的键的值与列表中的元素进行比较以避免冗余?

来源:互联网 

I currently have a list which stores the URLs that I have read from a file. I then made a dictionary by mapping those URLs to a simple key (0,1,2,3, etc.). Now I want to make sure that if the same URL shows up again that it doesn't get mapped to a different key. So I am trying to make a conditional statement to check for that. Basically I want to check if the item in the list( the URL) is the same as the value of any of the keys in the dictionary. If it is I don't want to add it again since that would be redundant. I'm not sure what to put inside the if conditional statement for this to work.I currently have a list which stores the URLs t




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: