Python function to modify a tuple


Topic: Python function to modify a tuple

Solution

def modify_tuple(t):
    print(f'Initial t mem-add = {id(t)}')
    t[0].append(100)
    print(f'Final t mem-add = {id(t)}')



List all Python Programs