Question #257265

Write an if/else statement that compares sold_yesterday and sold_today, and based upon that comparison assigns sales_trend the value -1 (the case where sold_yesterday is greater than sold_today) or 1.



Expert's answer



def greater(sold_yesterday,sold_today):
    if sold_today>sold_today:
        sales_trend = -1
    else:
        sales_trend = 1
    return sales_trend
print(greater(100,200))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS