Skip to content

Replace a list of elements with regex

I have a text full of adverbes and it’s replacements like this : And i want the adverbes to replaced in my text: Example : but am runing out of solutions, my code so far: I couldn’t find a way to replace each adverbes with the appropriate replacement. the list_adverbes_replacement.txt is the text …

Color values for opencv detection

This is a basic Detection of a specific color script in python taken from here. I am trying to work with “#34659F” color. I checked the above values, and they dont correspond to blue region. I check both the uppler and lower values and found that they dont correspond to blue values. I tried to sel…

How can I count the depth in a list of lists?

I want to count the depth in a list of lists, so not the amount of elements but the maximum depth one list can have. This is my function: should return 4 Answer You can try: Output: Explanation: First check if object passed into the recursive function is of type list: If so, proceed to add up the Trues in