NPTEL The Joy Of Computing Using Python Assignment 5 Answers 2022

NPTEL The Joy Of Computing Using Python Assignment 5

Are you looking for the Answers to NPTEL The Joy Of Computing Using Python Assignment 5? This article will help you with the answer to the National Programme on Technology Enhanced Learning (NPTEL) Course NPTEL The Joy Of Computing Using Python Assignment 5 ”. So read the complete article carefully.

What is The Joy Of Computing Using Python?

The Joy Of Computing Using Python is a fun-filled whirlwind tour of 30 hrs, covering everything you need to know to fall in love with the most sought-after skill of the 21st century. This course includes examples of analytics in a wide variety of industries, and we hope that students will learn how you can use analytics in their careers and life. One of the most important aspects of this course is that you, the student, are getting hands-on experience creating analytics models; we, the course team, urge you to participate in the discussion forums and to use all the tools available to you while you are in the course!

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the average of best 8 assignments out of the total 12 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

Below you can find the answers for NPTEL The Joy Of Computing Using Python Assignment 5 Answers

Assignment No.Answers
The Joy Of Computing Assignment 1 Click Here
The Joy Of Computing Assignment 2 Click Here
The Joy Of Computing Assignment 3 Click Here
The Joy Of Computing Assignment 4 Click Here
The Joy Of Computing Assignment 5 Click Here
The Joy Of Computing Assignment 6 Click Here
The Joy Of Computing Assignment 7 Click Here
The Joy Of Computing Assignment 8 Click Here

NPTEL The Joy Of Computing Using Python Assignment 5 Answers 2022:-

Q1. What is the syntax to create a dictionary?

  1. D = []
  2. D = {}
  3. D = ()
  4. D = dictionary()

Answer:- B

The answers will be Uploaded Shortly and it will be notified on Telegram. So Join Now

Q2. What is the correct statement about dictionaries?

  1. There can be multiple same keys.
  2. Every value must be unique.
  3. Every key must be unique.
  4. We can’t get every key from the dictionary.

Answer:-c

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

  1. d.key()
  2. d.item()
  3. d.value()
  4. d.keys()

Answer:-d

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

  1. 20 ‘30’
  2. ‘20’ ‘30’
  3. 20 30
  4. a b

Answer:-a

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

  1. ‘a’ ‘b’ ‘c’
  2. 20 30 50
  3. (‘a’, 20), (‘b’, 30), (‘c’, 50)
  4. (‘a’, ‘b’, ‘c’) (20, 30, 50)

Answer:- c

???? Next Week Answers: Assignment 05 ????

quizxp telegram

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

  1. Creates a dictionary with keys in range 0-19 and values 0
  2. Creates a dictionary with keys in range a-t and values 0.
  3. Creates a dictionary with keys in range a-z and values in range 0-19.
  4. Creates a dictionary with keys in range a-t and values in range 0-19.

Answer:- b

Q7. What does the following code mimics?

  • Distribute 1000 marbles evenly in every bag.
  • Distribute 500 marbles randomly in every bag.
  • Distribute 1000 marbles randomly in every bag.
  • Throws an error.

Answer:-c

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

1)

https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc22_cs31/JOC_W5_Q8.A.PNG

2)

https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc22_cs31/JOC_W5_Q8.B.PNG

3)

https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc22_cs31/JOC_W5_Q8.C.PNG

4)

https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc22_cs31/JOC_W5_Q8.D.PNG

Answer:- d

Q9. Binary search is applicable in?

  1. Unsorted list.
  2. Only in the list which is sorted in ascending order.
  3. Only in the list which is sorted in descending order.
  4. Any sorted list.

Answer:- d

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

https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc22_cs31/JOC_W5_Q10.PNG
  1. The first element of the initial list.
  2. The largest element of the list.
  3. The smallest element of the list.
  4. Throws an error.

Answer:- b

Programming Assigment week 5

Q1. You are given a string S. Write a function count_letters which will return a dictionary containing letters (including special character) in string S as keys and their count in string S as values.

Code:-

def count_letters(string):
  d={}
  for s in string:
    if s not in d:
      d[s]=string.count(s)
  return(d)
  

Q2. You are given a list L. Write a function uniqueE which will return a list of unique elements is the list L in sorted order. (Unique element means it should appear in list L only once.)

Code:-

def uniqueE(L):
  ans=[]
  for a in L:
    if L.count(a)==1:
      ans.append(a)
  return(sorted(ans))
    

Q3. You are given a list L. Write a program to print first prime number encountered in the list L.(Treat numbers below and equal to 1 as non prime)

Code:-

prime_numbers=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
               53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109,
               113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197,
               199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293]
for a in L:
  if a in prime_numbers:
    print(a,end="")
    break

For other courses answers:- Visit

For Internship and job updates:- Visit

Disclaimer: We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.

if you have any suggestions then comment below or contact us at [email protected]

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.