# NPTEL The Joy Of Computing Using Python Week 6 Assignment Answer 2023

NPTEL The Joy Of Computing Using Python Week 6 Assignment Solutions

## NPTEL The Joy Of Computing Using Python Week 6 Assignment Answer 2023

1. What will be the output of the following code?

Shift every letter in a given word by value.
Shift every letter in a given word by 1.
Shift every letter in a given word by 26.
Returns the same word.

`Answer :-For Answer Click Here`

2. In the list L = [4,6,7,4,6,2,1], What is the index of element ‘7’?

• 0
• 1
• 2
• 3
`Answer :- For Answer Click Here`

3. Which of the following is true about recursion?

• Recursion always performs better than non-recursive code.
• Recursive code is easier to debug.
• The base case is necessary for recursion.
• Recursive code can be shorter than non-recursive code
`Answer :- For Answer Click Here`

4. What will be the output of the following program?

• Calculating sum of first n terms.
• Calculating product of first n terms.
• Calculating power of first n terms.
• Calculating sum of last n terms.
`Answer :- For Answer Click Here`

5. In Caesar cipher,the mediator needs to make maximum of how many trails to break the code?

• 1
• 26
• no trail needed
• 10
`Answer :- For Answer Click Here`

6. What is the output of the following program?

• 3628800
• Runs into an infinite loop
• 55
• Syntax error
`Answer :- For Answer Click Here`

7. What’s the correct code for Binary search?

`Answer :- For Answer Click Here`

8. Which of the following is TRUE about MIN-MAX strategy?

• Maximize the chances of your winning and minimize the changes of the opponent winning
• The game with min-max strategy can never be drawn
• Minimize the chances of your winning and maximize the chances of the opponent winning
• All the above are true
`Answer :- For Answer Click Here`

9. A program that is written recursively cannot be written in a non-recursive manner.

• True
• False
`Answer :- For Answer Click Here`

10. what will be the output of the following program?

**********
*********
********
*******
******
*****
****
***
**
*

*********
*******
*****
***
*

Runs into infinite loop

**********
********
******
****
**
*

`Answer :- For Answer Click Here`