Using Python
Define a function called to find the level of quality:
if quality= 3 or 4, quality_level=poor
if quality= 5 or 6, quality_level=fair
if quality=7 or 8, quality_level=good
then use the map function find the corresponding quality level for
the quality,
add the new column to a data frame
import pandas as pd
lst = []
num = int(input("Enter a Quality Level: "))
if (num ==3 or num ==4):
print("Quality Level is POOR")
if (num ==5 or num ==6):
print("Quality Level is FAIR")
if (num ==7 or num ==8):
print("Quality Level is GOOD")
for i in range(0, num):
ele = int(input())
lst.append(ele)
print(lst)
Thank you
Happy learning
Get Answers For Free
Most questions answered within 1 hours.