Given the following code snippet: 1. 2. 3. 4. 5. 6. 7 8. 9. listA= [1,3,8,12,5,2,71 max=ListA[0] for i in range (1, len
Posted: Tue Jul 05, 2022 10:25 am
Given the following code snippet: 1. 2. 3. 4. 5. 6. 7 8. 9. listA= [1,3,8,12,5,2,71 max=ListA[0] for i in range (1, len (listA)): if (max< lista): max= listA print (max) Output: 12 Examine the code snippet again and discuss whether the code is functional programming or not by providing how should the code follows the rule of functional programming. 6 marks Construct a new function and apply recursive concepts to replace the code snippet. 10 marks