반응형 float(-inf)1 What is the point of float("-inf"), float("inf") I simply copy and paste a post that was posted on stackoverflow. It acts as an unbounded upper value for comparison. This is useful for finding lowest values for something. for example, calculating path route costs when traversing trees.e.g. Finding the "cheapest" path in a list of options:>>> lowest_path_cost = float('inf') >>> # pretend that these were calculated using some worthwhile algorith.. 2019. 1. 22. 이전 1 다음 반응형