# NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer

We Discuss About That NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer

NPTEL Programming Data Structures And Algorithms Using Python Assignment Answer – Here All The Questions and Answers Provided to Help All The Students and NPTEL Candidate as a Reference Purpose, It is Mandetory to Submit Your Weekly Assignment By Your Own Understand Level.

Are you looking for the Assignment Answers to NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer? If Yes You are in Our Great Place to Getting Your Solution, This Post Should be help you with the Assignment answer to the National Programme on Technology Enhanced Learning (NPTEL) Course “NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer”

## NPTEL Programming Data Structures And Algorithms Using Python Assignment

This course is an introduction to programming and problem solving in Python.  It does not assume any prior knowledge of programming.  Using some motivating examples, the course quickly builds up basic concepts such as conditionals, loops, functions, lists, strings and tuples.  It goes on to cover searching and sorting algorithms, dynamic programming and backtracking, as well as topics such as exception handling and using files.  As far as data structures are concerned, the course covers Python dictionaries as well as classes and objects for defining user defined datatypes such as linked lists and binary search trees.

INTENDED AUDIENCE: Students in any branch of mathematics/science/engineering, 1st year

PREREQUISITES:          School level mathematics.

INDUSTRY SUPPORT:   This course should be of value to any company requiring programming skills.

This course can have Associate in Nursing unproctored programming communication conjointly excluding the Proctored communication, please check announcement section for date and time. The programming communication can have a weightage of twenty fifth towards the ultimate score.

Final score = Assignment score + Unproctored programming exam score + Proctored Exam score
• Assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
• ( All assignments in a particular week will be counted towards final scoring – quizzes and programming assignments).
• Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam – out of 100
• Proctored Exam score =50% of the proctored certification exam score out of 100
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF ASSIGNMENT SCORE >=10/25 AND
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50.
If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100.

## BELOW YOU CAN GET YOUR NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer 2022? :

Q1. Consider the following Python function.

What does mystery([22,14,19,65,82,55]) return?

`Answer:- [55, 82, 65, 19, 14, 22]`

Q2. What is the value of pairs after the following assignment?

`Answer:- [(4,5), (4,2), (3,3), (2,4)]`

Q3. Consider the following dictionary.

Which of the following statements does not generate an error?

`Answer:- c. wickets["ODI"]["Ashwin"] = [4,4]`

Q4. Assume that hundreds has been initialized as an empty dictionary:

Which of the following generates an error?

`Answer:- d.hundreds[["Tendulkar","international"]] = 100`

## Week 4 Programming Assignment

Q1. Write two Python functions as specified below. Paste the text for both functions together into the submission window. Your function will be called automatically with various inputs and should return values as specified. Do not write commands to read any input or print any output.

Code:-

``````def frequency(l):
SET=set(l)
LIST=list(SET)
newl=list()
for a in LIST:
newl.append(l.count(a))
mi=min(newl)
ma=max(newl)
mil=[]
mal=[]
for b in range(len(newl)):
if newl[b]==mi:

mil.append(LIST[b])
if newl[b]==ma:

mal.append(LIST[b])
mil.sort()
mal.sort()
return(mil,mal)

def onehop(l):
ans=list()
l.sort()
for x in range(len(l)):
for y in range(len(l)):
if l[x]!=l[y]:
if l[x]==l[y]:
q=l[x]
w=l[y]
if q!=w:
t=[q,w]
t=tuple(t)
if t not in ans:
ans.append(tuple(t))
ans.sort()
return (ans)   ``````

## Programming Data Structures And Algorithms Using Python Assignment Answers  Quiz Assignment

Q1. Consider the following Python function.

``````def mystery(l,v):
if len(l) == 0:
return (v)
else:
return (mystery(l[:-1],l[-1]+v))``````

What does mystery([22,14,19,65,82,55],1) return?

Q2. What is the value of triples after the following assignment?

``triples = [ (x,y,z) for x in range(2,4) for y in range(2,5) for z in range(5,7) if 2*x*y > 3*z ]``

Q3. Consider the following dictionary.

`runs = {"Test":{"Rahul":[90,14,35],"Kohli":[3,103,73,42],"Pujara":[53,15,133,8]},"ODI":{"Sharma":[37,99],"Kohli":[63,47]}}`

Q4. Assume that actor has been initialized as an empty dictionary:

``actor = {}``

Answer:- c – actor[[“Star Wars”, “Rey”]] = “Ridley”

All questions carry equal weightage. All Python code is assumed to be executed using Python3. You may submit as many times as you like within the deadline. Your final submission will be graded.

Note:

• If the question asks about a value of type list, remember to enclose your answer in square brackets and use commas to separate list items.

Q1. Write three Python functions as specified below. Paste the text for all three functions together into the submission window. Your function will be called automatically with various inputs and should return values as specified. Do not write commands to read any input or print any output.

• You may define additional auxiliary functions as needed.
• In all cases you may assume that the value passed to the function is of the expected type, so your function does not have to check for malformed inputs.
• For each function, there are normally some public test cases and some (hidden) private test cases.
• “Compile and run” will evaluate your submission against the public test cases.
• “Submit” will evaluate your submission against the hidden private test cases. There are 10 private test cases, with equal weightage. You will get feedback about which private test cases pass or fail, though you cannot see the actual test cases.
• Ignore warnings about “Presentation errors”.
1. Define a Python function remdup(l) that takes a nonempty list of integers l and removes all duplicates in l, keeping only the first occurrence of each number. For instance:
2. Write a Python function sumsquare(l) that takes a nonempty list of integers and returns a list [odd,even], where odd is the sum of squares all the odd numbers in l and even is the sum of squares of all the even numbers in l.
3. A two dimensional matrix can be represented in Python row-wise, as a list of lists: each inner list represents one row of the matrix. For instance, the matrix

Code:-

``````def remdup(l):
L=[]
for i in l:
if i not in L:
L.append(i)
return(L)

def sumsquare(l):
odd_sum=0
even_sum=0
for a in l:
if a%2!=0:
odd_sum+=a*a
else:
even_sum+=a*a
return([odd_sum,even_sum])

def transpose(m):
ans=list()
for i in range(len(m)):
a=[]
for j in range(len(m)):
a.append(m[j][i])
ans.append(a)
return(ans)``````
`Yhaa You have done it but next? if YOU Want to your Others NPTEL Programming Data Structures And Algorithms Using Python Assignment 4 Answer Then Follow US HERE and Join Telegram.`
{"ft_lang_label":"__label__en","ft_lang_prob":0.7619784,"math_prob":0.89546025,"size":6620,"snap":"2022-40-2023-06","text_gpt3_token_len":1634,"char_repetition_ratio":0.118651755,"word_repetition_ratio":0.15831663,"special_character_ratio":0.2602719,"punctuation_ratio":0.1493652,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9927419,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-01T08:40:54Z\",\"WARC-Record-ID\":\"<urn:uuid:b943be76-6601-43dd-9dec-011c89540b40>\",\"Content-Length\":\"130784\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:05930a79-5dff-41b6-925d-68e5158bcf91>\",\"WARC-Concurrent-To\":\"<urn:uuid:d31b0bb4-4f9f-424f-a8a8-1f80d7718579>\",\"WARC-IP-Address\":\"82.180.143.223\",\"WARC-Target-URI\":\"https://scishowengineer.com/nptel-programming-data-structures-and-algorithms-using-python-assignment-4-answer/\",\"WARC-Payload-Digest\":\"sha1:O6ZV7OTFDG5TC7GFZWUU47N227OMBE76\",\"WARC-Block-Digest\":\"sha1:2JYRKFLEMLB2MTPXUNCJAP6IJ5FBL7AQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764499919.70_warc_CC-MAIN-20230201081311-20230201111311-00454.warc.gz\"}"}