- 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 1 (45.38 KiB) Viewed 7 times
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
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 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
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