Question #228345

For this problem, the prefilled code will contain a list of tuples. Write a program to replace the last number of each tuple in the list with the given number (N).

Expert's answer

lst = [(10, 12, 43), (54, 0, 77), (3, 24, 81, 99), (19, 36)]
n = int(input())
lst = [el[0:-1] + (n,) for el in lst]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS