Just wondering over here, what is the point of having a variable store an infinite value in a program? Is there any actual use and is there any case where it would be prefer
float('inf') can be used in the comparison, thus making the code simpler and clear. For instance, in merge sort, a float('inf') can be added to the end of subarrays as a sentinel value. Don't confuse with the usage of infinity in maths, after all, programming is not all about maths.