Skip to content
← Computer Science

Computer Science · Class 12 Optional

Ch 7Understanding Data — Class 12 Computer Science, concept-first.

Every day, people make choices based on data or information. When you pick a college for admission, you look at placement records from previous years, the qualifications and experience of faculty, the quality of labs and hostels, and the fees charged.

97

Q&A

23

Concepts

40m

Section weightage

Computational Thinking and Programming – 2 · across all 7 lessons

Start learning — read this chapter →

Key concepts

Hover a concept to preview it and jump to its most relevant Q&A.

In previous exams

How often this chapter’s concepts have been examined — real appearance data, never estimated.

Chapter contents

The NCERT structure, section by section. Open a section to see its questions, then read the concept-first solution.

7.1

Introduction to Data

Every day, people make choices based on data or information. When you pick a college for admission, you look at placement records from previous years, the qualifications and experience of faculty, the…

7.1.1

Importance of Data

Data is the foundation of almost every decision we make, whether personal or professional. Without data, choices are based on guesswork; with data, they become informed, measurable, and often reveal p…

7.1.2

Types of Data

2 Q

Data comes from many sources, and its format depends entirely on where it originates. An image is a grid of pixels, a video is a sequence of frames, a fee slip mixes numbers and text, and a chat messa…

7.2

Data Collection

Data collection is the first step in any data processing task. Before you can analyse or store data, you must first gather it.

7.3

Data Storage

Once data has been gathered and processed to produce results, it is rarely thrown away. Instead, we store it for future reference and reuse.

7.4

Data Processing

Data processing is the bridge between raw data and useful information. A collection of numbers, text, or images by itself does not give us answers.

7.5

Statistical Techniques for Data Processing

Given a set of data values, we need to process them to get information. There are various techniques which help us to have preliminary understanding about the data.

7.5.1

Measures of Central Tendency

4 Q

A measure of central tendency is a single value that gives us some idea about the data. Instead of looking at every individual data value, we can calculate one of these measures to understand the aver…

7.5.2

Measures of Variability

3 Q

The measures of variability tell you about the spread or variation of values around the mean. They are also called measures of dispersion, and they indicate the degree of diversity in a data set.

Summary

- Data refer to unorganised facts that can be processed to generate meaningful result or information.

Exercises

CBSE Sample Papers

Questions from official CBSE sample papers.

+Show 77 questions77 questions
  1. Q1State True or False: "A Python List must always contain all its elements of same data type."Preview
  2. Q2What will be the output of the following statement? ```python print(14%3**2*4) ``` (A) 16 (B) 64 (C) 20 (D) 256Preview
  3. Q3Identify the correct output of the following code snippet: game="Olympic2024" print(game.index("C")) (A) 0 (B) 6 (C) -1 (D) ValueErrorPreview
  4. Q4Which of the following is the correct identifier? (A) global (B) Break (C) def (D) withPreview
  5. Q5Identify the invalid Python statement out of the following options: (A) `print("A",10,end="*")` (B) `print("A",sep="*",10)` (C) `print("A",1…Preview
  6. Q6Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and…Preview
  7. Q7Consider the statements given below and then choose the correct output from the given options: ```python D={'S01':95, 'S02':96 } for I in D:…Preview
  8. Q8Which of the following built-in function/method returns a dictionary ? (A) dict() (B) keys() (C) values() (D) items()Preview
  9. Q9What does the return statement do in a function ? Explain with the help of an example.Preview
  10. Q10Consider the following dictionaries, D and D1 : D={"Suman": 40, "Raj":55, "Raman":60} D1={"Aditi":30, "Amit":90,"Raj":20} (Answer using buil…Preview
  11. Q11The code given below accepts N as an integer argument and returns the sum of all integers from 1 to N. Observe the following code carefully…Preview
  12. Q12State True or False : In Python, data type of 74 is same as the data type of 74.0.Preview
  13. Q13Identify the output of the following code snippet : s = "the Truth" print(s.capitalize()) (A) The truth (B) THE TRUTH (C) The Truth (D) the…Preview
  14. Q14Which of the following expressions in Python evaluates to True ? (A) 2>3 and 2<3 (B) 3>1 and 2 (C) 3>1 and 3>2 (D) 3>1 and 3<2Preview
  15. Q15What is the output of the following code snippet ? s='War and Peace by Leo Tolstoy' print(s.partition("by")) (A) ('War and Peace ', 'by', '…Preview
  16. Q16What will be the output of the following statement ? print("PythonProgram"[-1:2:-2])Preview
  17. Q17What will be the output of the following code snippet ? t = tuple('tuple') t2 = t[2], t += t2 print(t) (A) ('tuple') (B) ('tuple','p') (C) (…Preview
  18. Q18Which of the following statements is true about dictionaries in Python ? (A) A dictionary is an example of sequence datatype. (B) A dictiona…Preview
  19. Q19If L is a list with 6 elements, then which of the following statements will raise an exception ? (A) L.pop(1) (B) L.pop(6) (C) L.insert(1,6)…Preview
  20. Q20What will be the output of the following code ? def f1(a,b=1): print(a+b,end='-') c=f1(1,2) print(c,sep='*') (A) 3-2 (B) 3-2* (C) 3-None (D)…Preview
  21. Q21Q. Nos. 20 and 21 are Assertion (A) and Reason (R) based questions. Mark the correct choice as : (A) Both Assertion (A) and Reason (R) are t…Preview
  22. Q22What is the difference between default parameters and positional parameters in Python ? Also give an example of a function header which uses…Preview
  23. Q23Assuming that D1 is a dictionary in Python, (i) (a) Write a Python expression to check if the key, 'RNo' is present in D1. OR (b) Write a Py…Preview
  24. Q24What possible output(s) from the given options will NOT be displayed when the following code is executed ? Also, mention, for how many itera…Preview
  25. Q25The function given below is written to accept a string s as a parameter and return the number of vowels appearing in the string. The code ha…Preview
  26. Q26State True or False: While defining a function in Python, the positional parameters in the function header must always be written after the…Preview
  27. Q27What will be the output of the following statement: print(16*5/4*2/5-8) (A) -3.33 (B) 6.0 (C) 0.0 (D) -13.33Preview
  28. Q28What possible output from the given options is expected to be displayed when the following Python code is executed? import random Signal = […Preview
  29. Q29Identify the invalid Python statement from the following: (A) d = dict() (B) e = {} (C) f = [] (D) g = dict{}Preview
  30. Q30Identify the statement from the following which will raise an error: (A) print("A"*3) (B) print(5*3) (C) print("15" + 3) (D) print("15" + "1…Preview
  31. Q31Q. 17 and 18 are ASSERTION (A) and REASONING (R) based questions. Mark the correct choice as (A) Both (A) and (R) are true and (R) is the co…Preview
  32. Q32The code given below accepts five numbers and displays whether they are even or odd. Observe the following code carefully and rewrite it aft…Preview
  33. Q33(A) Write a user defined function in Python named showGrades(S) which takes the dictionary S as an argument. The dictionary, S contains Name…Preview
  34. Q34(A) Write the Python statement for each of the following tasks using built-in functions/methods only: (i) To remove the item whose key is "N…Preview
  35. Q35Predict the output of the following code: def callon(b=20,a=10): b=b+a a=b-a print(b,"#",a) return b x=100 y=200 x=callon(x,y) print(x,"@",y…Preview
  36. Q36Write the output on execution of the following Python code: S="Racecar Car Radar" L=S.split() for W in L: x=W.upper() if x==x[::-1]: for I i…Preview
  37. Q37State True or False. "Identifiers are names used to identify a variable, function in a program".Preview
  38. Q38Which of the following is a valid keyword in Python? (a) false (b) return (c) non_local (d) nonePreview
  39. Q39Given the following Tuple Tup=(10, 20, 30, 50) Which of the following statements will result in an error? (a) print(Tup[0]) (b) Tup.insert(2…Preview
  40. Q40Consider the given expression: 5<10 and 12>7 or not 7>4 Which of the following will be the correct output, if the given expression is evalua…Preview
  41. Q41Select the correct output of the code: S="Amrit Mahotsav @ 75" A=S.partition(" ") print(A) (a) ('Amrit Mahotsav', '@', '75') (b) ['Amrit', '…Preview
  42. Q42Which of the following operators will return either True or False? (a) += (b) != (c) = (d) *=Preview
  43. Q43Which of the following statement(s) would give an error after executing the following code? stud={"Murugan":100, "Mithu":95} # Statement 1 p…Preview
  44. Q44What will the following expression be evaluated to in Python? print(4+3*5/3-5%2) (a) 8.5 (b) 8.0 (c) 10.2 (d) 10.0Preview
  45. Q45Which function returns the sum of all elements of a list? (a) count() (b) sum() (c) total() (d) add()Preview
  46. Q46Q. 17 and 18 are Assertion (A) and Reasoning (R) based questions. Mark the correct choice as (a) Both (A) and (R) are true and (R) is the co…Preview
  47. Q47Atharva is a Python programmer working on a program to find and return the maximum value from the list. The code written below has syntactic…Preview
  48. Q48Write a functions EOReplace() in Python, which accepts a list L of numbers. Thereafter, it increments all even numbers by 1 and decrements a…Preview
  49. Q49State True or False. "Comments are not executed by interpreter."Preview
  50. Q50Which of the following is not a sequential datatype in Python ? (a) Dictionary (b) String (c) List (d) TuplePreview
  51. Q51Given the following dictionary Day={1:"Monday", 2: "Tuesday", 3: "Wednesday"} Which statement will return "Tuesday". (a) Day.pop() (b) Day.p…Preview
  52. Q52Consider the given expression : 7<4 or 6>3 and not 10==10 or 17>4 Which of the following will be the correct output if the given expression…Preview
  53. Q53Fill in the blank : ___________ is not a valid built-in function for list manipulations. (a) count() (b) length() (c) append() (d) extend()Preview
  54. Q54Which of the following is an example of identity operators of Python ? (a) is (b) on (c) in (d) not inPreview
  55. Q55What will the following expression be evaluated to in Python ? print(6/3 + 4**3//8-4) (a) 6.5 (b) 4.0 (c) 6.0 (d) 4Preview
  56. Q56Which of the following functions is a valid built-in function for both list and dictionary datatype ? (a) items() (b) len() (c) update() (d)…Preview
  57. Q57Ravi, a Python programmer, is working on a project in which he wants to write a function to count the number of even and odd values in the l…Preview
  58. Q58Which of the following is not a valid variable name in Python? Justify reason for it not being a valid name. (i) 5Radius (ii) Radius_ (iii)…Preview
  59. Q59Which of the following are keywords in Python? (i) break (ii) check (iii) range (iv) whilePreview
  60. Q60Name the Python Library modules which need to be imported to invoke the following functions: (i) cos() (ii) randint()Preview
  61. Q61Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. input('Enter a word',W)…Preview
  62. Q62What possible output(s) are expected to be displayed on screen at the time of execution of the program from the following code? Also specify…Preview
  63. Q63Write the names of the immutable data objects from the following: (i) List (ii) Tuple (iii) String (iv) DictionaryPreview
  64. Q64Write a Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and corresponding values as 'Reena', 'Rakesh', 'Zareen…Preview
  65. Q65Which of the options out of (i) to (iv) is the correct data type for the variable Vowels as defined in the following Python statement? Vowel…Preview
  66. Q66Write the output of the following Python code: for i in range(2,7,2): print(i * '$')Preview
  67. Q67Write the output of the following Python code: def Update(X=10): X += 15 print('X = ', X) X=20 Update() print('X = ', X)Preview
  68. Q68Write a Recursive function in Python RecsumNat(N), to return the sum of the first N natural numbers. For example, if N is 10 then the functi…Preview
  69. Q69Write the names of any four data types available in Python.Preview
  70. Q70Name the Python Library modules which need to be imported to invoke the following functions: (i) sqrt() (ii) start()Preview
  71. Q71Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. 250 = Number WHILE Numb…Preview
  72. Q72Find and write the output of the following python code: Msg1="WeLcOME" Msg2="GUeSTs" Msg3="" for I in range(0,len(Msg2)+1): if Msg1[I]>="A"…Preview
  73. Q73Write four features of object oriented programming.Preview
  74. Q74class Box: #Line 1 L = 10 #Line 2 Type="HARD" #Line 3 def __init__(self,T,TL=30): #Line 4 self.Type = T #Line 5 self.L = TL #Line 6 def Disp…Preview
  75. Q75Define a class HOUSE in Python with the following specifications: Instance Attributes - Hno # House Number - Nor # Number of Rooms - Type #…Preview
  76. Q76Answer the questions (i) to (iii) based on the following: class Furniture(object): #Line 1 def __init__(self,Q): #Line 2 self.Qty = Q def Ge…Preview
  77. Q77Write a python method/function Swapper(Numbers) to swap the first half of the content of a list Numbers with second half of the content of l…Preview