Previously, if a string was not in a list and you try to remove it, a segmentation fault would occur since we would try to access the element at the nth position, if the list has n elements. I have refactored the code so that this access does not happen. I also rewrote the error statement to correctly get the type, if it is a string.
Previously, if a string was not in a list and you try to remove it, a segmentation fault would occur since we would try to access the element at the nth position, if the list has n elements. I have refactored the code so that this access does not happen. I also rewrote the error statement to correctly get the type, if it is a string.