Task You are given a Sensor class. Do not modify the class….
Task You are given a Sensor class. Do not modify the class. class Sensor: def __init__(self, name, unit): “””Initializes a Sensor object. Accepts name (string) and unit (string) “”” self.name = name self.unit = unit self.readings = [] def add_reading(self, value): “””Accepts a float value””” self.readings.append(value) def average(self): return sum(self.readings) / len(self.readings) def __str__(self): return f”{self.name}: avg={self.average()} {self.unit}” Ask for a sensor name: “Sensor name: ” Ask for a unit: “Unit: ” Create a Sensor object with those values. Ask for 3 readings, prompting for each with: “Reading: ” and add each reading to the sensor’s readings. Print the Sensor object. Example Input/Output Sensor name: temperature Unit: Celsius Reading: 25.0 Reading: 30.0 Reading: 35.0 Temperature: avg=30.0 Celsius