Problem with dictionary key in Python -


For some projects, I have to create a dictionary that contains the keys URL, from which I have this URL:

The URL is too long to fit here I think in the same line I can create a dictionary without any error, this URL is also an important one. But for some reason when I want to remove values ​​associated with this key (url) I can not get the error and get the error: "Do anyone know what is wrong with this url? Dictionary is sensitive to some things? Thanks

The code below is :

  def initialize_sumWTP_table (cursor): cursor.excute (choose 'url, calculate tags with sumWTP' '') rows = cursor fetchall () for url, number of tag rows : SumWTP [url] = TagsCount  

It is almost impossible that the dictionary "you Key "is missing, I think the string (case, or how the query string has been ordered) has some minor changes in the string, which results in the same effective URL, but with a slightly different string.

If this is the case, find a way to "normalize" URLs.


Comments