Jun-25-2018, 10:24 PM
Hi all, hoping someone can help me. I have an array that finds the range in difference between highest and lowest positive integers. I can accomplish this bit, however if a negative integer(s) is inserted within the array. I need to find a way that the negative integers aren't included in the output?
daily_sales = [-5, 8, 12, 23, 7, 56, 99, 65] lowest = min(daily_sales) highest = max(daily_sales) negative = 0 if x in range(len([daily_sales])) < 1: print() else: difference = highest - lowest print(difference)