Software logic problem
bag1 = int(input('Bag 1 weight is: ')) bag2 = int(input('Bag 2 weight is: ')) if bag1+bag2 <= 46: print('good') if bag1+bag2 > 46: print('You have too much packed.') elif bag1 >= 23: print('Bag 1 is too heavy.') elif bag2 >= 23: print('Bag 2 is too heavy.') This is a code that i have been working On and runs perfectly but the probelm arises. Let me explain. These are the three rules: Each bag has to be under or equal to 23 and if any bag is higher then 23, display the heavy bag eg- bag 1 is heavy Total weight should be 46 or lower and if higher then 46 then it should display “you have packed too much” If total weight is 46 and all bag are 23, then show “good” Now the only logic I am having trouble is the 3rd rule. Also, in future if i ever encounter this problem... then how do I approach + any tips of shortening the code and making it efficient?