+ 1

Im unable to figure out why my code wont output, its for calculating material ratios at my job in can packaging

This is the portion of the code Im designing for figuring out how much we can do with limited material: pack = input() cases = float(input()) _355_or_473 = input() sizes = [355,473] packs = [12,15,24,30] if pack in packs: print(pack,'pack') if pack == 12: if _355_or_473 == 355: cans=(cases*4320*12) cans/=7780 print(cans/7780,'Can Pallets') if _355_or_473 == 473: cans=(cases*3360*12) cans/=6224 print(cans,'Can Pallets') if pack == 15: cans=(cases*2400*15) cans/=7780 print(cans,'Can Pallets') if pack == 24: cans=(cases*2025*24) cans/=7780 print(cans,'Can Pallets') if pack == 30: cans=(cases*2700*30) cans/=7780 print(cans,'Can Pallets')

18th Feb 2023, 9:44 PM
Tyler Page
4 Respuestas
+ 7
Your first and third inputs are strings. You compare them with a number.
18th Feb 2023, 10:10 PM
Paul
Paul - avatar
+ 2
wouldn't a printed table or graph work just as well? it would only be pack vs cases for two types of pallets.
18th Feb 2023, 11:33 PM
Bob_Li
Bob_Li - avatar
+ 1
A typical example for input here would be 12 3.5 355 For the cases variable it would be our case pallets, which I plan to create a more literal translation to the total cases after I fix this this problem
18th Feb 2023, 9:59 PM
Tyler Page
+ 1
Thanks paul, rookie mistake lol
19th Feb 2023, 2:14 PM
Tyler Page