Can someone give me an example of a use case for this function please? I don't really see the point - in the example given, we know that the 3rd bit is on, we can see it.
The two cases I thought of were:
1) If we had an integer as opposed to the binary and wanted to find out if a bit was on.
………….. but we could just do print bin(x).
2) If the binary string was extremely long so looking was difficult
……………but we would have to type out an extremely long mask that would be difficult to get right
So, what's the point?