Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Assignment # 6

Dear students read the given lectures carefully as per the course objectives mentioned on the top
and carryout the assignment as per following instructions

1. Submission on LMS

2. You must prepare handwritten solution of the assignment

3. Attempt the Assignment after reading the lecture notes given below, watching the videos
(mentioned above), and doing self-learning of the topic from web.

QUESTION:Define a recursive functionin Python named sub_er (i.e. substitute embedded-


recursive) . It should take three arguments; old-value, new-value, and a list which could be
nested. The function should replace old-value with the new-value from the given list. Also
TRACE the sample function call given below;

>>> sub_er (10, 5, [10, 8, [10, 12], 10)


[ 5 , 8 , [5 , 12], 5]

You might also like