NPTEL Programming Data Structures And Algorithms Using Python Assignment 1 Answers 2024

NPTEL Programming Data Structures And Algorithms Using Python Assignment 1 Answers 2024

Hello learners In this article we are going to discuss NPTEL Programming Data Structures And Algorithms Using Python Assignment 1 Answers. All the Answers provided below to help the students as a reference, You must submit your assignment with your own knowledge and use this article as reference only.

About the course:-

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. 

NPTEL Programming Data Structures And Algorithms Using Python Assignment 1 Answers 2024:

1. What does f(27182818) return, for the following function definition?

def f(x):
  d=0
  while x > 1:
    (x,d) = (x/2,d+1)
  return(d)
Answer :- Will update answers soon and update on our telegram channel so Join Click Here

2. What is h(60)-h(45), given the definition of h below?

def h(n):
    s = 0
    for i in range(2,n):
        if n%i == 0:
           s = s+i
    return(s)

Answer :-

3. For what value of n would g(375,n) return 4?

def g(m,n):
    res = 0
    while m >= n:
        (res,m) = (res+1,m/n)
    return(res)
Answer :- 

4. Consider the following function mys:

def mys(m):
    if m == 1:
        return(1)
    else:
        return(m*mys(m-1))
Answer :-