Key Fixes: 1.target was misspelled as targ in a few places.
2.ranges() should be range().
3.*** should be ** for exponentiation.
4.sol.append() should be solutions.append().
5.printf should be replaced with print in Python.
6.Corrected the loop and removed unnecessary semicolons.