We Discuss About That NPTEL Programming Data Structures And Algorithms Using Python Assignment 2 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 2 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Â **Nation**** al Programme on Technology Enhanced LearningÂ (NPTEL)** Course

**âNPTEL Programming Data Structures And Algorithms Using Python Assignment 2 Answerâ**

Table of Contents

## NPTEL Programming Data Structures And Algorithms Using Python Assignment

**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.

**Next Week Assignment Answers**

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.

- 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.Â**

**CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERSÂ **

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

**?**:

**1. One of the following 10 statements generates an error. Which one? (Your answer should be a number between 1 and 10.)**

```
x = [[3,5],"mimsy",2,"borogove",1] # Statement 1
y = x[0:50] # Statement 2
z = y # Statement 3
w = x # Statement 4
x[1] = x[1][:5] + 'ery' # Statement 5
y[1] = 4 # Statement 6
w[1][:3] = 'fea' # Statement 7
z[4] = 42 # Statement 8
x[0][0] = 5555 # Statement 9
a = (x[3][1] == 1) # Statement 10
```

Answer:-7

**2. Consider the following lines of Python code.
**

Which of the following holds at the end of this code?

a. a[0] == 47, b[3] == 73, c[3] == 73, d[1] == 47

b. a[0] == 65, b[3] == 105, c[3] == 73, d[1] == 95

c. a[0] == 65, b[3] == 73, c[3] == 73, d[1] == 95

d. a[0] == 95, b[3] == 73, c[3] == 73, d[1] == 95

```
b = [43,99,65,105,4]
a = b[2:]
d = b[1:]
c = b
d[1] = 95
b[2] = 47
c[3] = 73
```

Answer:-c

**3. What is the value ofÂ endmsgÂ after executing the following lines?**

```
startmsg = "anaconda"
endmsg = ""
for i in range(1,1+len(startmsg)):
endmsg = endmsg + startmsg[-i]
```

Answer:-âanacondaâ

**4. What is the value ofÂ mylistÂ after the following lines are executed?**

```
def mystery(l):
l = l[2:]
return(l)
mylist = [7,11,13,17,19,21]
mystery(mylist)
```

Answer:-[7, 11, 13, 17, 19, 21]

## Programming Data Structures And Algorithms Using Python Assignment 2 Coding Solutions July 2022

**Q1. Write a functionÂ intreverse(n)Â that takes as input a positive integerÂ nÂ and returns the integer obtained by reversing the digits inÂ n.
**

Write a functionÂ matched(s)Â that takes as input a stringÂ sÂ and checks if the bracketsÂ â(âÂ andÂ â)âÂ inÂ sÂ are matched: that is, everyÂ â(âÂ has a matchingÂ â)âÂ after it and everyÂ â)âÂ has a matchingÂ â(âÂ before it. Your function should ignore all other symbols that appear inÂ s. Your function should returnÂ TrueÂ ifÂ sÂ has matched brackets andÂ FalseÂ if it does not.

**Write a functionÂ sumprimes(l)Â that takes as input a list of integersÂ lÂ and retuns the sum of all the prime numbers inÂ l.**

**Code:-**

```
def intreverse(n):
ans = 0
while n > 0:
(d,n) = (n%10,n//10)
ans = 10*ans + d
return(ans)
def matched(s):
nested = 0
for i in range(0,len(s)):
if s[i] == "(":
nested = nested+1
elif s[i] == ")":
nested = nested-1
if nested < 0:
return(False)
return(nested == 0)
def factors(n):
factorlist = []
for i in range(1,n+1):
if n%i == 0:
factorlist = factorlist + [i]
return(factorlist)
def isprime(n):
return(factors(n) == [1,n])
def sumprimes(l):
sum = 0
for i in range(0,len(l)):
if isprime(l[i]):
sum = sum+l[i]
return(sum)
```

Yhaa You have done it but next? if YOU Want to your OthersNPTEL Programming Data Structures And Algorithms Using Python Assignment 2 AnswerThenÂFollow US HEREÂandÂJoin Telegram.