weight

PythonF

Sort based on Weight

The program must accept N integers as the input. For each integer X, the program must find the sum of the weights based on the…