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.
sold_yesterday = int(input('Enter sold_yesterday: '))
sold_today = int(input('Enter sold_today: '))
if sold_yesterday > sold_today:
sales_trend = -1
else:
sales_trend = 1
print(sales_trend)
Comments
Leave a comment