Generation

generate functionTue, 23 May 2023

Hallar el promedio de los que son mayores a 500 y el promedio de los que son menores a 500

def average(marks): total = 0 count = 0 for m in marks: if m >= 500: total += m count += 1 return total / count def average_w(marks): total = 0 count = 0 for m in marks: if m < 500: total += m count += 1 return total / count marks = [80, 200, 500, 300, 90, 600, 100, 1000, 220]

Want to kickstart your project?Use the new AI Studio to create your code