Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

NPTEL The Joy Of Computing Using Python Assignment 5 Answers 2022

NPTEL The Joy Of Computing Using Python Assignment 5 Answers (Week 5)

Q1. What is the syntax to create a dictionary?

a. D = []

b. D = {}

c. D = ()

d. D = dictionary()

Answer: b. D = {}


Q2. What is the correct statement about dictionaries?

a. There can be multiple same keys.
b. Every value must be unique.
c. Every key must be unique.
d. We can’t get every key from the dictionary.

Answer: c. Every key must be unique.


Q3. What is the correct syntax to get all the keys only from a dictionary d?

a. d.key()
b. d.item()
c. d.value()
d. d.keys()

Answer: d. d.keys()


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

The Joy Of Computing Using Python Assignment 5 Question 4

a. 20 ‘30’
b. ‘20’ ‘30’
c. 20 30
d. a b

Answer: a. 20 ‘30’


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

The Joy Of Computing Using Python Assignment 5 Question 5

a. ‘a’ ‘b’ ‘c’
b. 20 30 50
c. (‘a’, 20), (‘b’, 30), (‘c’, 50)
d. (‘a’, ‘b’, ‘c’) (20, 30, 50)

Answer: c. (‘a’, 20), (‘b’, 30), (‘c’, 50)


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

The Joy Of Computing Using Python Assignment 5 Question 6

a. Creates a dictionary with keys in range 0-19 and values 0
b. Creates a dictionary with keys in range a-t and values 0.
c. Creates a dictionary with keys in range a-z and values in range 0-19.
d. Creates a dictionary with keys in range a-t and values in range 0-19.

Answer: b. Creates a dictionary with keys in range a-t and values 0.


Q7. What does the following code mimics?

The Joy Of Computing Using Python Assignment 5 Question 7

a. Distribute 1000 marbles evenly in every bag.
b. Distribute 500 marbles randomly in every bag.
c. Distribute 1000 marbles randomly in every bag.
d. Throws an error.

Answer: c. Distribute 1000 marbles randomly in every bag.


Q8. What is the correct code to choose rock, paper, or scissors correctly?

a.

The Joy Of Computing Using Python Assignment 5 Question 8a

b.

The Joy Of Computing Using Python Assignment 5 Question 8b

c.

The Joy Of Computing Using Python Assignment 5 Question 8c

d.

The Joy Of Computing Using Python Assignment 5 Question 8d

Answer: d.

The Joy Of Computing Using Python Assignment 5 Question 8d

Q9.Binary search is applicable in?

a. Unsorted list.
b. Only in the list which is sorted in ascending order.
c. Only in the list which is sorted in descending order.
d. Any sorted list.

Answer: d. Any sorted list.


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

The Joy Of Computing Using Python Assignment 5 Question 10

a. The first element of the initial list.
b. The largest element of the list.
c. The smallest element of the list.
d. Throws an error.

Answer: b. The largest element of the list.


Disclaimer: These answers are provided only for the purpose to help students to take references. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.


Also Available:

NPTEL Data Science for Engineers Assignment 5

NPTEL Cloud Computing Week 5 Assignment Answers

Related Posts