First of all, the inputs do not come separated by spaces, but in new lines. So inp.split(" ") will not separate the 3/2/1 scores into final.
You should follow the instruction you shared through the linked PDF.
Your
for i in range(1, ((int(final[0]) - 1) + 2)):
result = result + (final[len(final) - 1])
is weird as well.
Here's what you should do:
- Read 3 lines. The first will contain the 3, the second the 2, and the third the 1-point shot counts.
- Then you calculate the total score by multiplying the counts (read from the three lines) with the score values (3/2/1).
- You do it for both teams (A and B) and print A or B depending on who has the higher score. Or T if it's a tie.
- When done, test it with the inputs provided in the PDF (example section). Then test it for more inputs on your own. Test for corner cases. Test if you determine the win of A, B, or even the tie.