An automated cargo freighter is being loaded with supply modules. To ensure a stable launch, the freighter must be loaded with cargo up to a specific target payload weight (in tonnes, t). Several supply modules will be loaded one by one, each contributing a different weight towards this target.
Write a Python program that asks the operator for the target payload weight and works out when the target is reached or exceeded. Each supply module can have a different weight.
The program should:
Optimal load achieved.Excess payload is followed by the difference (as a positive number) showing by how much the modules exceeded the target.You should use indentation as appropriate, meaningful variable name(s), and Python syntax in your answer.