HardjunoIndracahya / aqi-calculator

Block comment should start with # FLK-E265
Style
Minor
a year agoa year old
block comment should start with '# '
50    aqi = round(((aqi_high[i_high] - aqi_low[i_low]) / (c_high[i_high] - c_low[i_low])) * (concentration - c_low[i_low]) + aqi_low[i_low])
51    return aqi
52
53#Function to prompt user for input and calculate PM2.5 and PM10 concentrations and AQI.54def calc_pm():
55    while True:
56        print("\nPlease select the particle type you want to count.:")
block comment should start with '# '
42    else:
43        raise ValueError("Invalid pollutant. Choose 'PM2.5' or 'PM10'.")
44
45#Calculate AQI46    i_low = 0
47    while concentration > c_high[i_low]:
48        i_low += 1
block comment should start with '# '
27    
28#Calculate AQI based on pollutant concentration.
29#concentration: float, concentration value in µg/m³
30#pollutant: string, one of 'PM2.5' or 'PM10'31def calculate_aqi(concentration, pollutant):
32    if pollutant == 'PM2.5':
33        c_low = [0, 12.1, 35.5, 55.5, 150.5, 250.5, 350.5, 500.5]
block comment should start with '# '
26        return 'Input concentration is below AQI scale'
27    
28#Calculate AQI based on pollutant concentration.
29#concentration: float, concentration value in µg/m³30#pollutant: string, one of 'PM2.5' or 'PM10'
31def calculate_aqi(concentration, pollutant):
32    if pollutant == 'PM2.5':
block comment should start with '# '
25    else:
26        return 'Input concentration is below AQI scale'
27    
28#Calculate AQI based on pollutant concentration.29#concentration: float, concentration value in µg/m³
30#pollutant: string, one of 'PM2.5' or 'PM10'
31def calculate_aqi(concentration, pollutant):