Nov-05-2017, 12:41 PM
I think you need to declare your total_kg and rejected variables before the bag_check function, then use them globally, like this:
total_kg = 0 rejected = 0 def bag_check(material, weight, total_kg, rejected): global total_kg global rejected # the rest of the function