Task Write a program that reads values from data.csv and pri…

Task Write a program that reads values from data.csv and prints summary information. Import the csv module Open the file and use csv.reader() to read each row. Convert the second value in each row to a float. Print the following summary statistics: Count: Total: Average: where Count is the total number of values (hint: use len()), Total is the sum of the values (hint: use sum()), and Average is the average of the values, or Total / Count. File Contents (data.csv) A,10 B,20 C,30 D,40 Expected Output Count: 4 Total: 100.0 Average: 25.0

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

Task Write a program that keeps asking the user for two inte…

Task Write a program that keeps asking the user for two integers until valid input is given, then prints their sum. Use a loop that repeats until valid input is received. Ask for a first number: “Enter first number: ” Ask for a second number: “Enter second number: ” Attempt to convert both to integers inside a try/except after you have saved the input. If a ValueError occurs, print “Invalid input. Try again.” Once valid, print the sum in the format: “Sum: X” Example Input/Output Enter first number: abc Enter second number: 10 Invalid input. Try again. Enter first number: 5 Enter second number: 10 Sum: 15

Scenario. A program uses a given class to display course inf…

Scenario. A program uses a given class to display course information. Do not modify the class.Number of bugs to fix: 2 1 2 3 4 5 6 7 8 9 10 11 # Given class – DO NOT MODIFY class Course: def __init__(self, name, credits): self.name = name self.credits = credits def __str__(self): return f”{self.name} is worth {self.credits} credits.” course = Course(“COP2273”) course.__str__() Current output: Traceback (most recent call last):  File “”, line 10, in     course = Course(“COP2273”)             ^^^^^^^^^^^^^^^^^TypeError: Course.__init__() missing 1 required positional argument: ‘credits’ Expected output:Course: COP2273Credits: 3