English

NCERT solutions for Informatics Practices [English] Class 11 chapter 4 - Working with Lists and Dictionaries [Latest edition]

Advertisements

Chapters

NCERT solutions for Informatics Practices [English] Class 11 chapter 4 - Working with Lists and Dictionaries - Shaalaa.com
Advertisements

Solutions for Chapter 4: Working with Lists and Dictionaries

Below listed, you can find solutions for Chapter 4 of CBSE NCERT for Informatics Practices [English] Class 11.


ExerciseProgramming ProblemsCase Study Based Question
Exercise [Pages 75 - 76]

NCERT solutions for Informatics Practices [English] Class 11 4 Working with Lists and Dictionaries Exercise [Pages 75 - 76]

1. a)Page 75

What will be the output of the following statement?

list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)
1. b)Page 75

What will be the output of the following statement?

list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)
1. c)Page 75

What will be the output of the following statement?

list1 = [1,2,3,4,5,6,7,8,9,10]
list1[::-2]
list1[:3] + list1[3:]
1. d)Page 75

What will be the output of the following statement?

list1 = [1,2,3,4,5]
list1[len(list1)-1]
2. a)Page 75

Consider the following list myList. What will be the elements of myList after the following operation:

myList = [10,20,30,40]

myList.append([50,60])
2. b)Page 75

Consider the following list myList. What will be the elements of myList after the following operation:

myList = [10,20,30,40]

myList.extend([80,90])
3.Page 75

What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
 for i in range(0,len(myList)):
           if i%2 == 0:
                print(myList[i])
4. a)Page 75

What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
 del myList[3:]
 print(myList)
4. b)Page 75

What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
 del myList[:5]
 print(myList)
4. c)Page 75

What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
 del myList[::2]
 print(myList)
5.Page 75

Differentiate between append() and extend() functions of list.

6. a)Page 76

Consider a list:

list1 = [6, 7, 8, 9]

What is the difference between the following operation on the list1:

list1 * 2
6. b)Page 76

Consider a list:

list1 = [6, 7, 8, 9]

What is the difference between the following operation on the list1:

list1 *= 2
6. c)Page 76

Consider a list:

list1 = [6, 7, 8, 9]

What is the difference between the following operation on the list1:

list1 = list1 * 2
7.Page 76

The record of a student (Name, Roll No., Marks in five subjects and percentage of marks) is stored in the following list: stRecord = ['Raman', 'A-36', [56, 98, 99, 72, 69], 78.8]

Write Python statements to retrieve the following information from the list stRecord.

  1. Percentage of the student
  2. Marks in the fifth subject
  3. Maximum marks of the student
  4. Roll no. of the student
  5. Change the name of the student from ‘Raman’ to ‘Raghav’.
8. a)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(stateCapital.get("Bihar"))
8. b)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(stateCapital.keys())
8. c)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(stateCapital.values())
8. d)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(stateCapital.items())
8. e)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(len(stateCapital))
8. f)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print("Maharashtra" in stateCapital)
8. g)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

print(stateCapital.get("Assam"))
8. h)Page 76

Consider the following dictionary stateCapital:

stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}

Find the output of the following statement:

del stateCapital["Assam"]
print(stateCapital)
Programming Problems [Pages 76 - 77]

NCERT solutions for Informatics Practices [English] Class 11 4 Working with Lists and Dictionaries Programming Problems [Pages 76 - 77]

1.Page 76

Write a program to find the number of times an element occurs in the list.

2.Page 77

Write a program to read a list of n integers (positive as well as negative). Create two new lists, one having all positive numbers and the other having all negative numbers from the given list. Print all three lists.

3. iPage 77

Write a function that returns the largest element of the list passed as a parameter.

3. iiPage 77

Write a function to return the second largest number from a list of numbers.

4.Page 77

Write a program to read a list of n integers and find their median.

Note: The median value of a list of values is the middle one when they are arranged in order. If there are two middle values then take their average.

Hint: You can use a built-in function to sort the list.

5.Page 77

Write a program to read a list of elements. Modify this list so that it does not contain any duplicate elements, i.e., all elements occurring multiple times in the list should appear only once.

6.Page 77

Write a program to create a list of elements. Input an element from the user that has to be inserted in the list. Also input the position at which it is to be inserted.

7. a)Page 77

Write a program to read elements of a list.

The program should ask for the position of the element to be deleted from the list. Write a function to delete the element at the desired position in the list.

7. b)Page 77

Write a program to read elements of a list.

The program should ask for the value of the element to be deleted from the list. Write a function to delete the element of this value from the list.

8.Page 77

Write a Python program to find the highest 2 values in a dictionary.

9.Page 77

Write a Python program to create a dictionary from a string ‘w3resource’ such that each individual character mates a key and its index value for fist occurrence males the corresponding value in dictionary.

Expected output : {'3': 1, 's': 4, 'r': 2, 'u': 6, 'w': 0, 'c': 8, 'e': 3, 'o': 5}
10.Page 77

Write a program to input your friends’ names and Phone Numbers and store them in the dictionary as the key-value pair. Perform the following operations on the dictionary:

  1. Display the name and phone number of all your friends
  2. Add a new key-value pair in this dictionary and display the modified dictionary
  3. Delete a particular friend from the dictionary
  4. Modify the phone number of an existing friend
  5. Check if a friend is present in the dictionary or not
  6. Display the dictionary in sorted order of names
Case Study Based Question [Pages 78 - 79]

NCERT solutions for Informatics Practices [English] Class 11 4 Working with Lists and Dictionaries Case Study Based Question [Pages 78 - 79]

1.Page 78

For the SMIS System given in Chapter 5, let us do the following: Write a program to take in the roll number, name, and percentage of marks for n students of Class X. Write user-defined functions to

  • accept details of the n students (n is the number of students)
  • search details of a particular student on the basis of roll number and display the result
  • display the result of all the students
  • find the topper among them
  • find the subject toppers among them

(Hint: use Dictionary, where the key can be roll number and the value is an immutable data type containing the name and percentage).

Let’s peer review the case studies of others based on the parameters given under “DOCUMENTATION TIPS” at the end of Chapter 5 and provide feedback to them.

Case Study

1.Page 78

A bank is a financial institution that is involved in borrowing and lending money. With advancements in technology, online banking, also known as internet banking allows customers of a bank to conduct a range of financial transactions through the bank’s website anytime, anywhere. As part of the initial investigation, you are suggested to

  • collect a bank application form. After careful analysis of the form, identify the information required for opening a savings account. Also, enquire about the rate of interest offered for a saving account.
  • The basic two operations performed on an account are Deposit and Withdrawal. Write a menu-driven program that accepts either of the two choices of Deposit and Withdrawal, then accepts an amount, performs the transaction, and accordingly displays the balance. Remember, every bank has a requirement for a minimum balance which needs to be taken care of during withdrawal operations. Enquire about the minimum balance required in your bank.
  • Collect the interest rates for opening a fixed deposit in various slabs in a savings bank account. Remember, rates may be different for senior citizens.

Finally, write a menu-driven program having the following options (use functions and appropriate data types):

  • Open a savings bank account
  • Deposit money
  • Withdraw money
  • Take details, such as the amount and period for a Fixed Deposit, and display its maturity amount for a particular customer.
2.Page 79

Participating in a quiz can be fun as it provides a competitive element. Some educational institutes use it as a tool to measure the knowledge level, abilities, and/or skills of their pupils either on a general level or in a specific field of study. Identify and analyze popular quiz shows and write a Python program to create a quiz that should also contain the following functionalities besides the one identified by you as a result of your analysis.

  • Create an administrative user ID and password to categorically add, modify, or delete a question.
  • Register the student before allowing her or him to play a quiz.
  • Allow selection of category based on the subject area.
  • Display questions as per the chosen category.
  • Keep the score as the participant plays.
  • Display the final score.
3.Page 79

Our heritage monuments are our assets. They are a reflection of our rich and glorious past and an inspiration for our future. UNESCO has identified some Indian heritage sites as World heritage sites. Collect the following information about these sites:

  • What is the name of the site?
  • Where is it located?
    District
    State
  • When was it built?
  • Who built it?
  • Why was it built?
  • The website link (if any).

Write a Python program to

  • create an administrative user ID and password to add, modify or delete an entered heritage site in the list of sites.
  • display the list of world heritage sites in India.
  • search and display information about a world heritage site entered by the user.
  • display the name(s) of world heritage site(s) on the basis of the state input by the user.

Solutions for 4: Working with Lists and Dictionaries

ExerciseProgramming ProblemsCase Study Based Question
NCERT solutions for Informatics Practices [English] Class 11 chapter 4 - Working with Lists and Dictionaries - Shaalaa.com

NCERT solutions for Informatics Practices [English] Class 11 chapter 4 - Working with Lists and Dictionaries

Shaalaa.com has the CBSE Mathematics Informatics Practices [English] Class 11 CBSE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. NCERT solutions for Mathematics Informatics Practices [English] Class 11 CBSE 4 (Working with Lists and Dictionaries) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. NCERT textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in Informatics Practices [English] Class 11 chapter 4 Working with Lists and Dictionaries are .

Using NCERT Informatics Practices [English] Class 11 solutions Working with Lists and Dictionaries exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in NCERT Solutions are essential questions that can be asked in the final exam. Maximum CBSE Informatics Practices [English] Class 11 students prefer NCERT Textbook Solutions to score more in exams.

Get the free view of Chapter 4, Working with Lists and Dictionaries Informatics Practices [English] Class 11 additional questions for Mathematics Informatics Practices [English] Class 11 CBSE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×