Sorry, you do not have permission to ask a question, You must login to ask a question.

# NPTEL Joy of Computing Using Python Week 2 Assignment Answers 2023

Attention! students who enrolled in the Joy of Computing using Python course.

I have provided probable answers for all 10 quiz questions for week 2’s assignment. I encourage you to utilize these hints as a guide and complete the assignment before the deadline for submission.

## Joy of Computing Using Python Week 2 Assignment Answers

Q1. What are the applications of Python?

a. Image processing and graphic design applications

b. Enterprise and business applications development

c. Operating systems

d. All of the above

e. None of the above

Q2. Which of the following is not the correct variable name

Q3. Write the output of the following code.

``````L = [1,2,3,4,5,6,7,8,9]
print(L[::-1])``````

Q4. Predict the output of the following code:

``````L = [[1,2,3],[0,4,5],[0,0,6]]

for i in range (3):
for j in range(2,i-1,-1):
print(L[i][j], end = "")``````

Answer: b. 3 2 1 5 4 6

Q5. Find all the error(s)in the following code:

``````n = 10
1 = []
for i in range(10,n+10):
1.append(i**i)
for i in range (10,0,-1):
print(l[i])``````

Answer: a. Index out of range

b. Syntax error

Q6. What is the output of the following code:

``````def add_items(x,y):
x+= [1,2]
y+= (3,4)
l = 
t = (5,)
print(l, end="")
print(t)``````

Q7. What is the correct syntax for defining a function in Python?

Q8. What is the purpose of the continue statement in a for loop?

Answer: d. To skip the current iteration and move on to the next one, but only if a certain condition is met

Q9. How do you check if a number is even in Python?

Answer: a. if number % 2 == 0

Q10. What should be the value of _ to print all numbers from 0-10?

``````for i in range( _ ):
print(i)``````

### Joy of Computing Using Python Week 2 Programming Answers

Q1. Given an integer as an input, write a program to print that integer.

``print(num,end="")``

Q2. Given two integers as an input, write a program to print the sum of those two integers

``print(num1+num2,end="")``

Q3. You are given a number as an input. You have to display all the numbers from 0 till x.

``````for a in range(num+1):
if a==num:
print(a,end="")
else:
print(a)``````

Disclaimer: It is imperative to note that the responses provided here are solely for educational reference purposes. This platform does not guarantee the accuracy of the answers, hence it is strongly recommended to undertake your assignments independently.

Also Available:

NPTEL Joy of Computing using Python Assignment Answers Week 1

NPTEL The Joy of Computing using Python Assignment Answers Week 3

## NPTEL Programming In Java Week 6 Assignment Answers 2023 