Why isn't my String being detected in my Set? : I am having a very specific problem I am currently trying to find a string in a set. But for some reason it can't be found and its not triggering the code properly.


    while program_running:
    load_reddit()
    if not image_found:
        for images in hot_images:
            current_image = images.url
            if not images.stickied:
                if str(current_image).__contains__(".jpg"):


                    if not str(current_image) in past_images: # Issue is here.
                        for pastimages in past_images:
                            print(pastimages)
                            print(current_image)
                        image_found = True
                        time.sleep(600)

[The string I'm searching for and the list][1]


  [1]: https://i.stack.imgur.com/EZrOo.png

as you can see the "current_image" variable is returning exactly what is in "past_images". So why is the code running?

This is extremely frustrating as the result directly contradicts itself. With this coding statement the print() shouldn't even run. But it is. 