You can generate list of all possible combinations from using itertools.combinations()
Then check if sum of all those combinations will match the constat value that you have.
I don't know how efficient you want it to be but it surely is a one way to do it.
Example generating combinations: https://stackoverflow.com/a/56397669/25131836