Content text Computer Science Solved Papers.pdf
Computer Science 2025 Time allowed : 3 hours Maximum Marks : 70 General Instructions : (i) This question paper contains 37 questions. (ii) All question are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions. (iii) The paper is divided into 5 Sections — A, B, C, D and E. (iv) Section A, consists of 21 questions (1 to 21). Each question carries 1 mark. (v) Section B, consists of 7 questions (22 to 28). Each question carries 2 marks. (vi) Section C, consists of 3 questions (29 to 31). Each question carries 3 marks. (vii) Section D, consists of 4 questions (32 to 35). Each question carries 4 marks. (viii) Section E, consists of 2 questions (36 to 37). Each question carries 5 marks. (ix) All programming questions are to be answered using Python Language only. (x) In case of MCQs, text of the answer should also be written. SECTION–A (21 × 1 = 21) 1. State True or False: “A Python List must always contain all its elements of same data type.” [1] Ans. False Explanation: Python lists allow storage of different types of data . For Instance : L = [1,2,3,4] L1 = [“Abc”,12,15.5,True] 2. What will be the output of the following statement? [1] print(14 % 3 ** 2* 4) (A) 16 (B) 64 (C) 20 (D) 256 Ans. (C) 20 Explanation : 14 % 3 ** 2 * 4 = 14 % 9 * 4 = 5 * 4 = 20 (** has the highest priority) 3. Identify the correct output of the following code snippet: [1] game=”olympic2024” print(game.index(“C”)) (A) 0 (B) 6 (C) –1 (D) ValueError Ans. (D) ValueError Explanation : The character ‘C’ is not present in the string “Olympic2024”, the index() function returns a valueError. 4. Which of the following is the correct identifier? [1] (A) global (B) Break (C) def (D) with Ans. (B) Break Explanation : All of the others are keywords in python . The word break is a keyword. 5. Identify the invalid Python statement out of the following options: [1] (A) print ( “A” , 10 , end=” *” ) (B) print ( “A” , sep=”*” , 10 ) (C) print ( “A” , 10 , sep=”*” ) (D) print ( “A” *10) Ans. (B) print ( “A” , sep=”*” , 10 ) Explanation : To print certain values with a separator, all the values should be specified first and then the sep keyword has to be used. 6. Consider the statements given below and then choose the correct output from the given options: [1] L=[‘TIC’, ‘TAC’] print(L[::-1]) (A) ['CIT', 'CAT'] (B) ['TIC', 'TAC'] (C) ['CAT', 'CIT'1 (D) ['TAC', 'TIC'] Ans. (D) [‘TAC’, ‘TIC’] Explanation : The statement L[: : –1] means to print the contents of the list in reverse order. 7. Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and False otherwise? [1] (A) is (B) is not (C) and (D) or Ans. (A) is
Solved Papers 3 Explanation: Float are purely real numeric values , hence should not be enclosed in quotes. DATE, varchar and char should be enclosed in quotes. 16. State True or False: [1] If table A has 6 rows and 3 columns, and table B has 5 rows and 2 columns, the Cartesian product of A and B will have 30 rows and 5 columns. Ans. True Explanation: In case of Cartesian product of tables A,B Degree of resultant = DegreeA + DegreeB Cardinality of resultant = CardinalityA × CardinalityB Here Degree = 3 + 2 = 5 Cardinality = 6 × 5 = 30 17. Which of the following networking devices is used to regenerate and transmit the weakened signal ahead? [1] (A) Hub (B) Ethernet Card (C) Repeater (D) Modem Ans. (C) Repeater Explanation: A Repeater is a network device that regenerates and amplifies the source signal, so that it can travel to a larger distance. 18. Which of the following options is the correct protocol used for phone calls over the internet ? [1] (A) PPP (B) FTP (C) HTTP (D) VoIP Ans. (D) VoIP Explanation: The VoIP-Voice over internet protocol is used for video and voice transmission over internet. 19. Expand ARPANET. [1] Ans. ARPANET : Advanced Research Projects Agency Network Directions: Q. 20 and 21 are Assertion (A) and Reason (R) based questions. Mark the correct choice as (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A). (B) Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A). (C) Assertion (A) is true but, Reason (R) is false. (D) Assertion (A) is false but, Reason (R) is true. 20. Assertion (A) : For a binary file opened using ‘rb’ mode, the pickle.dump () method will display an error. [1] Reason (R) : The pickle.dump () method is used to read from a binary file. Ans. (C) Assertion (A) is true but, Reason (R) is false. Explanation: pickle.dump() method writes data to a binary file, hence for files opened with “rb” ( read binary) mode the above method will give error. 21. Assertion (A): We can retrieve records from more than one table in MYSQL. [1] Reason (R) : Foreign key is used to establish a relationship between two tables. Ans. (B) Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A). Explanation: Foreign key establishes relation between tables and this relation helps to retrieve data from multiple tables, but the reason stated is not the reason for the assertion statement. SECTION–B (7 × 2 = 1) 22. What does the return statement do in a function? Explain with the help of an example. [2] Ans. The return statement either returns the control to the calling function or returns a value from the called function to the calling function. def Mul(A,B) : return A*B m = Mul (100,200) Here the Mul () function receives A, B and returns the product of A, B to m. 23. Write one example of each of the following in Python: (i) Syntax Error (ii) Implicit Type Conversion [2] Ans. Syntax Error : if x = 50...... : missing , comparision is done by == print(“Hello’) Implicit type conversion a = 50 b = 9.95 b = a The integer value of a is automatically converted to float type value in b. 24. Consider the following dictionaries, D and D1: D={“Suman”: 40, “Raj” : 55, ‘Raman” : 60} D1=(“Aditi”: 30, “Amit”: 90,”Raj”: 20) [2] (Answer using built-in Python functions only) (i) (a) Write a statement to display/return the value corresponding to the key “Raj” in the dictionary D.