The following function calculates a discounted price based o…

The following function calculates a discounted price based on the discount percentage: def calculate_discount(price, discount_percent):   if discount_percent >= 50:        return price * 0.5   elif discount_percent >= 25:        return price * 0.75   elif discount_percent >= 10:        return price * 0.9   else:        return price Below are four unit test cases designed to test this function: def test_discount_50(self):   self.assertEqual(calculate_discount(100, 50), 50.0)    def test_discount_25(self):   self.assertEqual(calculate_discount(100, 30), 75.0)def test_discount_10(self):   self.assertEqual(calculate_discount(100, 15), 85.0)def test_no_discount(self):   self.assertEqual(calculate_discount(100, 5), 100.0) Which of the following test cases does NOT correctly verify the expected behavior of calculate_discount()?”

Below is the definition of the Book class: class Book:    de…

Below is the definition of the Book class: class Book:    def __init__(self, name, id, cost=0.0, pages=0):       self.name = name       self.category = id        self.cost = cost       self.pages = pages Which of the following attempts to create a Book object will raise an error?

The following code validates and categorizes temperature inp…

The following code validates and categorizes temperature inputs using exception handling. The program includes two functions: validate_temperature() checks if a temperature is above absolute zero (-273°C), and check_temperature_range() categorizes the temperature as too cold, below freezing, or above freezing. What is the output when the user inputs -30? def validate_temperature(temp):    if temp < -273:        raise ValueError("Temperature cannot be below absolute zero")    return "Valid temperature recorded"def check_temperature_range(temp):    if temp < -50:        raise ValueError("Temperature too cold for measurement")    elif temp < 0:        return "Below freezing"    else:        return "Above freezing"try:    user_input = int(input("Enter temperature in Celsius: "))    result1 = validate_temperature(user_input)    result2 = check_temperature_range(user_input)    print(f"Validation: {result1}, Range: {result2}")except ValueError as e:    print(f"Error: {e}")except Exception:    print("Error: An unknown error occurred")