Solution for NPTEL Programming, Data Structures and Algorithms using Python, Week 8 Programming Assignment

Question :- Find the longest palindrome As we all know, a palindrome is a word that equals its reverse. Here are some examples of palindromes: malayalam, gag, appa, amma. We consider any sequence consisting of the letters of the English alphabet to be a word. So axxb,abbba and bbbccddx are words for our purpose. And aaabbaaa, Read more…

ONLINE TEST 2-5 PM | Solution for NPTEL Programming, Data Structures and Algorithms using Python

All answers have been verified. Question – 1 :- Here is an function to return the maximum value in a list of integers. There is an error in this function. Provide an input list for whichmaxbad produces an incorrect output. def maxbad(l):   mymax = 0   for i in range(len(l)):     if l[i] > mymax:        mymax = l[i]   return(mymax) Answer:- [-3,-2,-1] Question – 2:- Read more…