Jun-09-2020, 12:35 PM
I think you want to call the function
try
getSonar
3 times, sum the result and divide by 3try
def multi_signal_cleanup(): return sum(getSonar() for _ in range(3))/3which is the equivalent of
def multi_signal_cleanup(): results = [] for _ in range(3): results.append(getSonar()) return sum(results)/3