{"id":4192,"date":"2023-09-15T12:30:26","date_gmt":"2023-09-15T07:00:26","guid":{"rendered":"https:\/\/cbsepython.in\/?p=4192"},"modified":"2023-09-19T21:39:24","modified_gmt":"2023-09-19T16:09:24","slug":"class-12-computer-science-sample-paper-with-explained-solution","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/class-12-computer-science-sample-paper-with-explained-solution\/","title":{"rendered":"Class 12 Computer Science Sample Paper with Explained Solution"},"content":{"rendered":"<h2><span style=\"color: #000000;\">Class 12 Computer Science Sample Paper with Explained Solution<\/span><\/h2>\n<p><span style=\"color: #000000;\">Session: 2023-24<\/span><\/p>\n<p><span style=\"color: #000000;\">Computer Science (083)<\/span><\/p>\n<p><span style=\"color: #000000;\">Sample Question Paper (Theory)<\/span><\/p>\n<p><span style=\"color: #000000;\">Time allowed: 3 Hours Maximum Marks: 70<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0General Instructions:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Please check this question paper contains 35 questions.<\/span><\/li>\n<li><span style=\"color: #000000;\">The paper is divided into 4 Sections- A, B, C, D and E.<\/span><\/li>\n<li><span style=\"color: #000000;\">Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.<\/span><\/li>\n<li><span style=\"color: #000000;\">Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.<\/span><\/li>\n<li><span style=\"color: #000000;\">Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.<\/span><\/li>\n<li><span style=\"color: #000000;\">Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.<\/span><\/li>\n<li><span style=\"color: #000000;\">Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.<\/span><\/li>\n<li><span style=\"color: #000000;\">All programming questions are to be answered using Python Language only.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">SECTION A<\/span><\/p>\n<p><span style=\"color: #000000;\">1.\u00a0 State True or False:<\/span><\/p>\n<p><span style=\"color: #000000;\">\u201cIn a Python program, if a break statement is given in a nested loop, it terminates the execution of all loops in one go.\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">Answer: False<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">A break statement in a nested loop in Python only terminates the innermost loop in which it is placed. It does not terminate the execution of all loops in one go. The outer loops will continue running as usual.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\">2. In a table in MYSQL database, an attribute A of datatype varchar(20) has the value \u201cKeshav\u201d. The attribute B of datatype char(20) has value \u201cMeenakshi\u201d. How many characters are occupied by attribute A and attribute B?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 20,6<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 6,20<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 9,6<\/span><\/p>\n<p><span style=\"color: #000000;\">d) 6,9<\/span><\/p>\n<p><span style=\"color: #000000;\">Correct Answer: b) 6,20<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">In MySQL, when you specify the datatype `varchar(20)` for attribute A, it means that it can store up to 20 characters. However, if you store the value &#8220;Keshav&#8221; in attribute A, it will occupy only 6 characters because &#8220;Keshav&#8221; has 6 characters.<\/span><\/p>\n<p><span style=\"color: #000000;\">Similarly, when you specify the datatype `char(20)` for attribute B, it means that it will always occupy 20 characters, regardless of the actual length of the value. So, even though &#8220;Meenakshi&#8221; has 9 characters, it will still occupy 20 characters in attribute B due to the `char` datatype.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3. What will be the output of the following statement:<\/span><\/p>\n<p><span style=\"color: #000000;\">print(3-2**2**3+99\/11)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 244<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 244.0<\/span><\/p>\n<p><span style=\"color: #000000;\">c) -244.0<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: c) -244.0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">The output of the given statement can be calculated as follows:<\/span><\/p>\n<p><span style=\"color: #000000;\">First, calculate the exponentiation: 2**3 = 8.<\/span><\/p>\n<p><span style=\"color: #000000;\">Next, calculate 2**8 = 256.<\/span><\/p>\n<p><span style=\"color: #000000;\">Then, calculate 99\/11 = 9.<\/span><\/p>\n<p><span style=\"color: #000000;\">Now, substitute these values back into the expression: 3 &#8211; 256 + 9<\/span><\/p>\n<p><span style=\"color: #000000;\">Now, perform the subtraction:\u00a0 -253 + 9<\/span><\/p>\n<p><span style=\"color: #000000;\">Finally, perform the addition: -244<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">4. Select the correct output of the code:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">s=\"Python is fun\"\r\nl=s.split()\r\ns_new=\"-\".join([l[0].upper(),l[1],l[2].capitalize()])\r\nprint(s_new)<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Options:<\/span><\/p>\n<p><span style=\"color: #000000;\">a) PYTHON-IS-Fun<\/span><\/p>\n<p><span style=\"color: #000000;\">b) PYTHON-is-Fun<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Python-is-fun<\/span><\/p>\n<p><span style=\"color: #000000;\">d) PYTHON-Is -Fun<\/span><\/p>\n<p><span style=\"color: #000000;\">Correct Answer: b) PYTHON-is-Fun<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">s is assigned the string &#8220;Python is fun.&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">l is created by splitting the string s into a list of words. The split() method splits the string at spaces, so l becomes [&#8216;Python&#8217;, &#8216;is&#8217;, &#8216;fun&#8217;].<\/span><\/p>\n<p><span style=\"color: #000000;\">s_new is created by joining the modified elements of the list l with hyphens. The modifications are as follows:<\/span><\/p>\n<p><span style=\"color: #000000;\">l[0].upper(): The first word &#8220;Python&#8221; is converted to uppercase, resulting in &#8220;PYTHON.&#8221;<\/span><br \/>\n<span style=\"color: #000000;\">l[1]: The second word &#8220;is&#8221; remains unchanged.<\/span><br \/>\n<span style=\"color: #000000;\">l[2].capitalize(): The third word &#8220;fun&#8221; is capitalized, resulting in &#8220;Fun.&#8221;<\/span><br \/>\n<span style=\"color: #000000;\">The modified elements &#8220;PYTHON,&#8221; &#8220;is,&#8221; and &#8220;Fun&#8221; are joined with hyphens, resulting in the final string &#8220;PYTHON-is-Fun.&#8221;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">5. In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta has degree 3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of Alpha and Beta?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 5,3<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 8,15<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 3,5<\/span><\/p>\n<p><span style=\"color: #000000;\">d) 15,8<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: b) 8, 15<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">The degree of the Cartesian product of two tables is the sum of the degrees of the individual tables. In this case, Alpha has a degree of 5, and Beta has a degree of 3. So, the degree of the Cartesian product of Alpha and Beta will be 5 + 3 = 8.<\/span><\/p>\n<p><span style=\"color: #000000;\">The cardinality of the Cartesian product of two tables is the product of their individual cardinalities. Alpha has a cardinality of 3, and Beta has a cardinality of 5. So, the cardinality of the Cartesian product of Alpha and Beta will be 3 * 5 = 15.<\/span><\/p>\n<p><span style=\"color: #000000;\">So, the degree of the Cartesian product is 8, and the cardinality is 15.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">6. Riya wants to transfer pictures from her mobile phone to her laptop. She uses Bluetooth Technology to connect two devices. Which type of network will be formed in this case?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) PAN<\/span><\/p>\n<p><span style=\"color: #000000;\">b) LAN<\/span><\/p>\n<p><span style=\"color: #000000;\">c) MAN<\/span><\/p>\n<p><span style=\"color: #000000;\">d) WAN<\/span><\/p>\n<p><span style=\"color: #000000;\">Correct Answer: a) PAN<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">In this case, when Riya uses Bluetooth technology to connect her mobile phone and laptop, a PAN (Personal Area Network) will be formed.<\/span><\/p>\n<p><span style=\"color: #000000;\">A PAN is a small, localized network that typically covers a short range, such as a few meters or feet. Bluetooth is commonly used for creating PANs because it&#8217;s designed for short-range wireless communication between devices like mobile phones, laptops, and peripherals.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">7. Which of the following will delete key-value pair for key = \u201cRed\u201d from a dictionary D1?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) delete D1(&#8220;Red&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">b) del D1[&#8220;Red&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">c) del.D1[&#8220;Red&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">d) D1.del[&#8220;Red&#8221;]<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: b) del D1[&#8220;Red&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">del is the Python keyword used for deletion.<\/span><br \/>\n<span style=\"color: #000000;\">D1 is the name of the dictionary.<\/span><br \/>\n<span style=\"color: #000000;\">[&#8220;Red&#8221;] is the key enclosed in square brackets, specifying the key-value pair to be deleted.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">8. Consider the statements given below and then choose the correct output from the given options:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pride=\"#G20 Presidency\"\r\n\r\nprint(pride[-2:2:-2])\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Options:<\/span><\/p>\n<p><span style=\"color: #000000;\">a) ndsr<\/span><\/p>\n<p><span style=\"color: #000000;\">b) ceieP0<\/span><\/p>\n<p><span style=\"color: #000000;\">c) ceieP<\/span><\/p>\n<p><span style=\"color: #000000;\">d) yndsr<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: b) ceieP0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">9. Which of the following statement(s) would give an error during execution of the following code?<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">tup = (20,30,40,50,80,79)\r\n\r\nprint(tup) #Statement 1\r\n\r\nprint(tup[3]+50) #Statement 2\r\n\r\nprint(max(tup)) #Statement 3\r\n\r\ntup[4]=80 #Statement 4<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Options:<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Statement 1<\/span><\/p>\n<p><span style=\"color: #000000;\">b) Statement 2<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Statement 3<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Statement 4<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Correct Answer: <span style=\"color: #000000;\">d) Statement 4<\/span><\/p>\n<p>Explanation:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">10. What possible outputs(s) will be obtained when the following code is executed?<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import random\r\nmyNumber=random.randint(0,3)\r\nCOLOR=[\"YELLOW\",\"WHITE\", \"BLACK\", \"RED\"]\r\nfor I in range (1, myNumber):\r\n    print (COLOR[I], end=\"*\")\r\n    print ()<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Options:<\/span><\/p>\n<p><span style=\"color: #000000;\">a.<\/span><\/p>\n<p><span style=\"color: #000000;\">RED*<\/span><\/p>\n<p><span style=\"color: #000000;\">WHITE*<\/span><\/p>\n<p><span style=\"color: #000000;\">BLACK*<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">b.<\/span><\/p>\n<p><span style=\"color: #000000;\">WHITE*<\/span><\/p>\n<p><span style=\"color: #000000;\">BLACK*<\/span><\/p>\n<p><span style=\"color: #000000;\">c.<\/span><\/p>\n<p><span style=\"color: #000000;\">WHITE* WHITE*<\/span><\/p>\n<p><span style=\"color: #000000;\">BLACK* BLACK*<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">d.<\/span><\/p>\n<p><span style=\"color: #000000;\">YELLOW*<\/span><\/p>\n<p><span style=\"color: #000000;\">WHITE*WHITE*<\/span><\/p>\n<p><span style=\"color: #000000;\">BLACK* BLACK* BLACK*<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer:<\/span><\/p>\n<p><span style=\"color: #000000;\">b.<\/span><\/p>\n<p><span style=\"color: #000000;\">WHITE*<\/span><\/p>\n<p><span style=\"color: #000000;\">BLACK*<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">11. Fill in the blank:<\/span><\/p>\n<p><span style=\"color: #000000;\">The modem at the sender\u2019s computer end acts as a ____________.<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Model<\/span><\/p>\n<p><span style=\"color: #000000;\">b) Modulator<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Demodulator<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Convertor<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: <\/span><\/p>\n<p><span style=\"color: #000000;\">b) Modulator<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">Because a modem is a device that stands for &#8220;Modulator-Demodulator.&#8221; It serves two primary functions:<\/span><\/p>\n<p><span style=\"color: #000000;\">Modulation: The sender&#8217;s modem (at the sender&#8217;s computer end) is responsible for modulating digital data into analog signals for transmission over analog communication channels, such as telephone lines or cable systems. This process involves changing the characteristics of the signal to encode the digital information.<\/span><\/p>\n<p><span style=\"color: #000000;\">Demodulation: At the receiving end, another modem (Demodulator) is responsible for converting the received analog signals back into digital data, effectively reversing the modulation process.<\/span><\/p>\n<p><span style=\"color: #000000;\">So, the modem at the sender&#8217;s computer end acts as a modulator, making option (b) &#8220;Modulator&#8221; the correct answer.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">12. Consider the code given below:\u00a0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">b=100\r\ndef test(a):\r\n    ______#missing statement\r\n    b=b+a\r\n    print(a,b)\r\ntest (10)\r\nprint(b)<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Which of the following statements should be given in the blank for #Missing Statement, if the output produced is 110?<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Options:<\/span><\/p>\n<p><span style=\"color: #000000;\">a) global a<\/span><\/p>\n<p><span style=\"color: #000000;\">b) global b=100<\/span><\/p>\n<p><span style=\"color: #000000;\">c) global b<\/span><\/p>\n<p><span style=\"color: #000000;\">d) global a=100<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: c) global b<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">In this code, we are trying to modify the global variable b within the function test. To do this, we need to explicitly declare b as a global variable inside the function using the global keyword.<\/span><\/p>\n<p><span style=\"color: #000000;\">With this modification, the global keyword allows us to access and modify the global variable b within the test function.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">13. State whether the following statement is True or False:<\/span><\/p>\n<p><span style=\"color: #000000;\">An exception may be raised even if the program is syntactically correct.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer: True. <\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\">An exception may be raised even if a program is syntactically correct.<\/span><\/p>\n<p><span style=\"color: #000000;\">In programming, exceptions are raised at runtime when there are errors or unexpected conditions that the program encounters, such as attempting to divide by zero, accessing an index that is out of bounds, or trying to open a file that doesn&#8217;t exist. These are often referred to as runtime errors, and they can occur even in programs that have correct syntax.<\/span><\/p>\n<p><span style=\"color: #000000;\">Syntax errors, on the other hand, are errors that occur when the code violates the rules of the programming language&#8217;s syntax, such as missing parentheses, incorrect indentation, or using undefined variables. These errors are detected by the compiler or interpreter during the parsing phase and prevent the program from running until they are fixed.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">14. Which of the following statements is FALSE about keys in a relational database?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Any candidate key is eligible to become a primary key.<\/span><\/p>\n<p><span style=\"color: #000000;\">b) A primary key uniquely identifies the tuples in a relation.<\/span><\/p>\n<p><span style=\"color: #000000;\">c) A candidate key that is not a primary key is a foreign key.<\/span><\/p>\n<p><span style=\"color: #000000;\">d) A foreign key is an attribute whose value is derived from the primary key of another relation.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer:\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\">The FALSE statement about keys in a relational database is:<\/span><\/p>\n<p><span style=\"color: #000000;\">c) A candidate key that is not a primary key is a foreign key.<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">This statement is not true. A candidate key that is not a primary key remains a candidate key and is not automatically considered a foreign key. In a relational database, a foreign key is an attribute that establishes a link between two relations (tables) by referencing the primary key of another relation. It is used to maintain referential integrity between the tables and enforce relationships, but it is not the same as a candidate key.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">15. Fill in the blank:<\/span><\/p>\n<p><span style=\"color: #000000;\">In case of _____________ switching, before a communication starts, a dedicated path is identified between the sender and the receiver.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Answer:Circuit switching<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">Circuit switching establishes a dedicated path for continuous communication, ensuring guaranteed bandwidth and low latency, making it suitable for real-time applications like voice calls.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">16. Which of the following functions changes the position of file pointer and returns its new position?<\/span><\/p>\n<p><span style=\"color: #000000;\">a) flush()<\/span><\/p>\n<p><span style=\"color: #000000;\">b) tell()<\/span><\/p>\n<p><span style=\"color: #000000;\">c) seek()<\/span><\/p>\n<p><span style=\"color: #000000;\">d) offset()<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Answer: <\/span><\/p>\n<p><span style=\"color: #000000;\">c) seek()<\/span><\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">The seek() function is used to change the position of the file pointer within a file and returns the new position. It allows you to navigate to a specific location in the file for reading or writing operations.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q 17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Both A and R are true and R is the correct explanation for A<\/span><\/p>\n<p><span style=\"color: #000000;\">b)Both A and R are true and R is not the correct explanation for A<\/span><\/p>\n<p><span style=\"color: #000000;\">c) A is True but R is False<\/span><\/p>\n<p><span style=\"color: #000000;\">d)A is false but R is True<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">17 Assertion(A): List is an immutable data type<\/span><\/p>\n<p><span style=\"color: #000000;\">Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer:<\/span><\/p>\n<p><span style=\"color: #000000;\">d) A is false but R is True<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">Assertion (A): &#8220;List is an immutable data type&#8221; is False. Lists in Python are mutable, which means you can modify their elements after creation.<\/span><\/p>\n<p><span style=\"color: #000000;\">Reasoning (R): &#8220;When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory&#8221; is true for immutable types like tuples, but it is not directly related to lists. Lists are mutable, so this reasoning doesn&#8217;t apply to them.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">18 Assertion(A): Python Standard Library consists of various modules.<\/span><\/p>\n<p><span style=\"color: #000000;\">Reasoning(R): A function in a module is used to simplify the code and avoids repetition.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Correct Answer:<\/span><\/p>\n<p><span style=\"color: #000000;\">b)Both A and R are true and R is not the correct explanation for A<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Explanation:<\/span><\/p>\n<p><span style=\"color: #000000;\">&#8211; Assertion (A): &#8220;Python Standard Library consists of various modules&#8221; is true. Python&#8217;s Standard Library indeed comprises various modules that provide a wide range of pre-written functionality for different tasks.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">&#8211; Reasoning (R): &#8220;A function in a module is used to simplify the code and avoids repetition&#8221; is also true. Functions within Python modules are designed to simplify code by encapsulating specific functionality, promoting code reusability, and avoiding redundancy. However, this reasoning does not directly explain why Python&#8217;s Standard Library consists of various modules. While modules often contain functions to avoid code repetition, the existence of multiple modules in the standard library is a broader organizational choice by the Python developers to group related functionality and provide a comprehensive set of tools for programmers.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">In other words, while both A and R are true, the reasoning (R) does not directly explain the assertion (A) about the composition of the Python Standard Library, which is why option b) is correct.<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">SECTION B<\/span><\/p>\n<p><span style=\"color: #000000;\">19 (i) Expand the following terms:<\/span><\/p>\n<p><span style=\"color: #000000;\">POP3 , URL<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Give one difference between XML and HTML.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0OR<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) Define the term bandwidth with respect to networks.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) How is http different from https?<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">20. The code given below accepts a number as an argument and returns the reverse number. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">define revNumber(num):\r\n    rev=0\r\n    rem=0\r\n    While num&gt;0:\r\n        rem==num%10\r\n        rev=rev*10+rem\r\n        num=num\/\/10\r\n        return rev\r\nprint (revNumber(1234))<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">21. Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as an argument and displays the names (in uppercase)of the places whose names are longer than 5 characters.<\/span><\/p>\n<p><span style=\"color: #000000;\">For example, Consider the following dictionary<\/span><\/p>\n<p><span style=\"color: #000000;\">PLACES={1:&#8221;Delhi&#8221;,2:&#8221;London&#8221;,3:&#8221;Paris&#8221;,4:&#8221;New York&#8221;,5:&#8221;Doha&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">The output should be:<\/span><\/p>\n<p><span style=\"color: #000000;\">LONDON<\/span><\/p>\n<p><span style=\"color: #000000;\">NEW YORK<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0OR<\/span><\/p>\n<p><span style=\"color: #000000;\">Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string.<\/span><\/p>\n<p><span style=\"color: #000000;\">For example, if the string is &#8220;Come let us have some fun&#8221;, the tuple will have (4, 3, 2, 4, 4, 3)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">22. Predict the output of the following code:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">S= \"LOST\"\r\nL =[10,21,33,4]\r\nD={}\r\nfor I in range (len (S)):\r\n    if I%2==0:\r\n        D[L.pop()]=S[I]\r\n    else:\r\n        D[L.pop()]=I+3 \r\nfor K,V in D.items ():\r\n    print (K, V, sep=\"*\")\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">23.\u00a0 Write the Python statement for each of the following tasks using BUILT-IN functions\/methods only:<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) To insert an element 200 at the third position, in the list L1.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) To check whether a string named, message ends with a full stop \/ period or not.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">OR<\/span><\/p>\n<p><span style=\"color: #000000;\">A list named studentAge stores age of students of a class. Write the Python command to import the required module and (using built-in function) to display the most common age value from the given list.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">24. Ms. Shalini has just created a table named \u201cEmployee\u201d containing columns Ename, Department and Salary.<\/span><\/p>\n<p><span style=\"color: #000000;\">After creating the table, she realized that she has forgotten to add a primary key column in the table. Help her in writing an SQL command to add a primary key column EmpId of integer type to the table Employee.<\/span><\/p>\n<p><span style=\"color: #000000;\">Thereafter, write the command to insert the following record in the table:<\/span><\/p>\n<p><span style=\"color: #000000;\">EmpId- 999<\/span><\/p>\n<p><span style=\"color: #000000;\">Ename- Shweta<\/span><\/p>\n<p><span style=\"color: #000000;\">Department: Production<\/span><\/p>\n<p><span style=\"color: #000000;\">Salary: 26900<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">OR<\/span><\/p>\n<p><span style=\"color: #000000;\">Zack is working in a database named SPORT, in which he has created a table named \u201cSports\u201d containing columns SportId, SportName, no_of_players, and category.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">After creating the table, he realized that the attribute, category has to be deleted from the table and a new attribute TypeSport of data type string has to be added. This attribute TypeSport cannot be left blank. Help Zack write the commands to complete both the tasks.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">25. Predict the output of the following code:\u00a0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def Changer (P,Q=10):\r\n    P-P\/Q\r\n    Q=P&amp;Q\r\n    return P\r\n\r\nA=200\r\nB=20\r\nA=Changer (A, B)\r\nprint (A, B, sep='$')\r\nB=Changer (B)\r\nprint (A, B, sep '$', end='###')\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">SECTION C<\/span><\/p>\n<p><span style=\"color: #000000;\">26. Predict the output of the Python code given below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Text1=\"IND-23\"\r\nText2=\"\"\r\nI=0\r\nwhile I&lt;len (Text1):\r\n    if Text1[I]&gt;=\"0\" and Text1 [I]&lt;=\"9\":\r\n        Val=int (Text1[I])\r\n        Val=Val + 1\r\n        Text2=Text2 + str(Val)\r\n    elif Text1[I]&gt;=\"A\" and Text1[I]&lt;=\"Z\":\r\n        Text2=Text2 + (Text1 [I+1])\r\n    else:\r\n        Text2=Text2 + \"*\"\r\n    I+=1\r\nprint (Text2)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">27. Consider the table CLUB given below and write the output of the SQL queries that follow.<\/span><\/p>\n<table width=\"58%\">\n<tbody>\n<tr>\n<td width=\"6%\"><strong>CID <\/strong><\/td>\n<td width=\"7%\"><strong>CNAME <\/strong><\/td>\n<td width=\"5%\"><strong>AGE <\/strong><\/td>\n<td width=\"8%\"><strong>GENDER <\/strong><\/td>\n<td width=\"11%\"><strong>SPORTS <\/strong><\/td>\n<td width=\"6%\"><strong>PAY <\/strong><\/td>\n<td width=\"13%\"><strong>DOAPP<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>5246 <\/strong><\/td>\n<td width=\"7%\">AMRITA<\/td>\n<td width=\"5%\">35<\/td>\n<td width=\"8%\">FEMALE<\/td>\n<td width=\"11%\">CHESS<\/td>\n<td width=\"6%\">900<\/td>\n<td width=\"13%\">2006-03-27<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>4687 <\/strong><\/td>\n<td width=\"7%\">SHYAM<\/td>\n<td width=\"5%\">37<\/td>\n<td width=\"8%\">MALE<\/td>\n<td width=\"11%\">CRICKET<\/td>\n<td width=\"6%\">1300<\/td>\n<td width=\"13%\">2004-04-15<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>1245 <\/strong><\/td>\n<td width=\"7%\">MEENA<\/td>\n<td width=\"5%\">23<\/td>\n<td width=\"8%\">FEMALE<\/td>\n<td width=\"11%\">VOLLEYBALL<\/td>\n<td width=\"6%\">1000<\/td>\n<td width=\"13%\">2007-06-18<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>1622 <\/strong><\/td>\n<td width=\"7%\">AMRIT<\/td>\n<td width=\"5%\">28<\/td>\n<td width=\"8%\">MALE<\/td>\n<td width=\"11%\">KARATE<\/td>\n<td width=\"6%\">1000<\/td>\n<td width=\"13%\">2007-09-05<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>1256 <\/strong><\/td>\n<td width=\"7%\">AMINA<\/td>\n<td width=\"5%\">36<\/td>\n<td width=\"8%\">FEMALE<\/td>\n<td width=\"11%\">CHESS<\/td>\n<td width=\"6%\">1100<\/td>\n<td width=\"13%\">2003-08-15<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>1720 <\/strong><\/td>\n<td width=\"7%\">MANJU<\/td>\n<td width=\"5%\">33<\/td>\n<td width=\"8%\">FEMALE<\/td>\n<td width=\"11%\">KARATE<\/td>\n<td width=\"6%\">1250<\/td>\n<td width=\"13%\">2004-04-10<\/td>\n<\/tr>\n<tr>\n<td width=\"6%\"><strong>2321 <\/strong><\/td>\n<td width=\"7%\">VIRAT<\/td>\n<td width=\"5%\">35<\/td>\n<td width=\"8%\">MALE<\/td>\n<td width=\"11%\">CRICKET<\/td>\n<td width=\"6%\">1050<\/td>\n<td width=\"13%\">2005-04-30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">(i) SELECT COUNT(DISTINCT SPORTS) FROM CLUB;<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) SELECT CNAME, SPORTS FROM CLUB WHERE DOAPP&lt;&#8220;2006-04-30&#8221; AND CNAME LIKE &#8220;%NA&#8221;;<\/span><\/p>\n<p><span style=\"color: #000000;\">(iii) SELECT CNAME, AGE, PAY FROM CLUB WHERE GENDER = &#8220;MALE&#8221; AND PAY BETWEEN 1000 AND 1200;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">28. Write a function in Python to read a text file, Alpha.txt and displays those lines which begin with the word \u2018You\u2019.<\/span><\/p>\n<p><span style=\"color: #000000;\">OR<\/span><\/p>\n<p><span style=\"color: #000000;\">Write a function, vowelCount() in Python that counts and displays the number of vowels in the text file named Poem.txt.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">29. Consider the table Personal given below:<\/span><\/p>\n<p><span style=\"color: #000000;\">Table: Personal<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P_ID <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Name <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Desig <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Salary <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Allowance<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P01 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Rohit <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Manager <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">89000 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">4800<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P02 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Kashish <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Clerk <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">NULL <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P03 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Mahesh <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Superviser <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">48000 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">NULL<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P04 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Salil <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Clerk <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">31000 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">1900<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">P05 <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Ravina <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">Superviser <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">NULL <\/span><\/td>\n<td style=\"width: 20%;\"><span style=\"color: #000000;\">2100<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color: #000000;\">Based on the given table, write SQL queries for the following:<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) Increase the salary by 5% of personals whose allowance is known.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column heading \u2018Total Salary\u2019 should also be displayed.<\/span><\/p>\n<p><span style=\"color: #000000;\">(iii) Delete the record of personals who have salary greater than 25000<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">30. A list, NList contains following record as list elements:<\/span><\/p>\n<p><span style=\"color: #000000;\">[City, Country, distance from Delhi]<\/span><\/p>\n<p><span style=\"color: #000000;\">Each of these records are nested together to form a nested list. Write the following user defined functions in Python to perform the specified operations on the stack named travel.<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) Push_element(NList): It takes the nested list as an argument and pushes a list object containing name of the city and country, which are not in India and distance is less than 3500 km from Delhi.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Pop_element(): It pops the objects from the stack and displays them. Also, the function should display \u201cStack Empty\u201d when there are no elements in the stack.<\/span><\/p>\n<p><span style=\"color: #000000;\">For example: If the nested list contains the following data:<\/span><\/p>\n<p><span style=\"color: #000000;\">NList=[[&#8220;New York&#8221;, &#8220;U.S.A.&#8221;, 11734],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8220;Naypyidaw&#8221;, &#8220;Myanmar&#8221;, 3219],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8220;Dubai&#8221;, &#8220;UAE&#8221;, 2194],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8220;London&#8221;, &#8220;England&#8221;, 6693],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8220;Gangtok&#8221;, &#8220;India&#8221;, 1580],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8220;Columbo&#8221;, &#8220;Sri Lanka&#8221;, 3405]]<\/span><\/p>\n<p><span style=\"color: #000000;\">The stack should contain:<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Naypyidaw&#8217;, &#8216;Myanmar&#8217;],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Dubai&#8217;, &#8216;UAE&#8217;],<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Columbo&#8217;, &#8216;Sri Lanka&#8217;]<\/span><\/p>\n<p><span style=\"color: #000000;\">The output should be:<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Columbo&#8217;, &#8216;Sri Lanka&#8217;]<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Dubai&#8217;, &#8216;UAE&#8217;]<\/span><\/p>\n<p><span style=\"color: #000000;\">[&#8216;Naypyidaw&#8217;, &#8216;Myanmar&#8217;]<\/span><\/p>\n<p><span style=\"color: #000000;\">Stack Empty<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">SECTION D<\/span><\/p>\n<p><span style=\"color: #000000;\">31. Consider the tables PRODUCT and BRAND given below:<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">Table: PRODUCT<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 168px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">PCode <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">PName <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">UPrice <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Rating <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">BID<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P01 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Shampoo <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">120 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M03<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P02 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Toothpaste <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">54 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">8 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M02<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P03 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Soap <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">25 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">7 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M03<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P04 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Toothpaste <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">65 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">4 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M04<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P05 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Soap <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">38 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">5 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M05<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">P06 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">Shampoo <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">245 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">6 <\/span><\/td>\n<td style=\"width: 20%; height: 24px;\"><span style=\"color: #000000;\">M05<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">Table: BRAND<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">BID <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">BName<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">M02 <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">Dant Kanti<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">M03 <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">Medimix<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">M04 <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">Pepsodent<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">M05 <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">Dove<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Write SQL queries for the following:<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) Display product name and brand name from the tables PRODUCT and BRAND.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Display the structure of the table PRODUCT.<\/span><\/p>\n<p><span style=\"color: #000000;\">(iii) Display the average rating of Medimix and Dove brands<\/span><\/p>\n<p><span style=\"color: #000000;\">(iv) Display the name, price, and rating of products in descending order of rating.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">32. Vedansh is a Python programmer working in a school. For the Annual Sports Event, he has created a csv file named Result.csv, to store the results of students in different sports events. The structure of Result.csv is :<\/span><\/p>\n<p><span style=\"color: #000000;\">[St_Id, St_Name, Game_Name, Result]<\/span><\/p>\n<p><span style=\"color: #000000;\">Where<\/span><\/p>\n<p><span style=\"color: #000000;\">St_Id is Student ID (integer)<\/span><\/p>\n<p><span style=\"color: #000000;\">ST_name is Student Name (string)<\/span><\/p>\n<p><span style=\"color: #000000;\">Game_Name is name of game in which student is participating(string) Result is result of the game whose value can be either &#8216;Won&#8217;, &#8216;Lost&#8217;or &#8216;Tie&#8217;<\/span><\/p>\n<p><span style=\"color: #000000;\">For efficiently maintaining data of the event, Vedansh wants to write the following user defined functions:<\/span><\/p>\n<p><span style=\"color: #000000;\">Accept() \u2013 to accept a record from the user and add it to the file Result.csv. The column headings should also be added on top of the csv file.<\/span><\/p>\n<p><span style=\"color: #000000;\">wonCount() \u2013 to count the number of students who have won any event. As a Python expert, help him complete the task.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">SECTION E<\/span><\/p>\n<p><span style=\"color: #000000;\">33. Meticulous EduServe is an educational organization. It is planning to setup its India campus at Chennai with its head office at Delhi. The Chennai campus has 4 main buildings \u2013 ADMIN, ENGINEERING, BUSINESS and MEDIA.<\/span><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-4198 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2023\/09\/CS-2024.jpg\" alt=\"\" width=\"495\" height=\"220\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2023\/09\/CS-2024.jpg 495w, https:\/\/cbsepython.in\/wp-content\/uploads\/2023\/09\/CS-2024-300x133.jpg 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>Block to Block distances (in Mtrs.)<\/strong><\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">From <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">To <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">Distance<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ADMIN <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ENGINEERING <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">55 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ADMIN <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">BUSINESS <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">90 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ADMIN <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">MEDIA <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">50 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ENGINEERING <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">BUSINESS <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">55 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">ENGINEERING <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">MEDIA <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">50 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">BUSINESS <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">MEDIA <\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">45 m<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">DELHI HEAD OFFICE<\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">CHENNAI CAMPUS<\/span><\/td>\n<td style=\"width: 33.3333%;\"><span style=\"color: #000000;\">2175 km<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Number of computers in each of the blocks\/Center is as follows:<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">ADMIN <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">110<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">ENGINEERING <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">75<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">BUSINESS <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">40<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">MEDIA <\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">12<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">DELHI HEAD OFFICE<\/span><\/td>\n<td style=\"width: 50%;\"><span style=\"color: #000000;\">20<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">a) Suggest and draw the cable layout to efficiently connect various blocks of buildings within the CHENNAI campus for connecting the digital devices.<\/span><\/p>\n<p><span style=\"color: #000000;\">b) Which network device will be used to connect computers in each block to form a local area network?<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Which block, in Chennai Campus should be made the server? Justify your answer.<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Which fast and very effective wireless transmission medium should preferably be used to connect the head office at DELHI with the campus in CHENNAI?<\/span><\/p>\n<p><span style=\"color: #000000;\">e) Is there a requirement of a repeater in the given cable layout? Why\/ Why not?<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">34 (i) Differentiate between r+ and w+ file modes in Python.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Consider a file, SPORT.DAT, containing records of the following structure:<\/span><\/p>\n<p><span style=\"color: #000000;\">[SportName, TeamName, No_Players]<\/span><\/p>\n<p><span style=\"color: #000000;\">Write a function, copyData(), that reads contents from the file SPORT.DAT and copies the records with Sport name as \u201cBasket Ball\u201d to the file named BASKET.DAT. The function should return the total number of records copied to the file BASKET.DAT.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">OR<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) How are text files different from binary files?<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) A Binary file, CINEMA.DAT has the following structure:<\/span><\/p>\n<p><span style=\"color: #000000;\">{MNO:[MNAME, MTYPE]}<\/span><\/p>\n<p><span style=\"color: #000000;\">Where<\/span><\/p>\n<p><span style=\"color: #000000;\">MNO \u2013 Movie Number<\/span><\/p>\n<p><span style=\"color: #000000;\">MNAME \u2013 Movie Name<\/span><\/p>\n<p><span style=\"color: #000000;\">MTYPE is Movie Type<\/span><\/p>\n<p><span style=\"color: #000000;\">Write a user defined function, findType(mtype), that accepts mtype as parameter and displays all the records from the binary file CINEMA.DAT, that have the value of Movie Type as mtype.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">35 (i) Define the term Domain with respect to RDBMS. Give one example to support your answer.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">(ii) Kabir wants to write a program in Python to insert the following record in the table named Student in MYSQL database, SCHOOL:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">rno(Roll number )- integer<\/span><\/li>\n<li><span style=\"color: #000000;\">name(Name) &#8211; string<\/span><\/li>\n<li><span style=\"color: #000000;\">DOB (Date of birth) \u2013 Date<\/span><\/li>\n<li><span style=\"color: #000000;\">Fee \u2013 float<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">Note the following to establish connectivity between Python and<\/span><\/p>\n<p><span style=\"color: #000000;\">MySQL:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Username &#8211; root<\/span><\/li>\n<li><span style=\"color: #000000;\">Password &#8211; tiger<\/span><\/li>\n<li><span style=\"color: #000000;\">Host &#8211; localhost<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">The values of fields rno, name, DOB and fee has to be accepted from the user. Help Kabir to write the program in Python.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">\u00a0OR<\/span><\/p>\n<p><span style=\"color: #000000;\">(i) Give one difference between alternate key and candidate key.<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) Sartaj has created a table named Student in MYSQL database,<\/span><\/p>\n<p><span style=\"color: #000000;\">SCHOOL:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">rno(Roll number )- integer<\/span><\/li>\n<li><span style=\"color: #000000;\">name(Name) &#8211; string<\/span><\/li>\n<li><span style=\"color: #000000;\">DOB (Date of birth) \u2013 Date<\/span><\/li>\n<li><span style=\"color: #000000;\">Fee \u2013 float<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">Note the following to establish connectivity between Python and<\/span><\/p>\n<p><span style=\"color: #000000;\">MySQL:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Username &#8211; root<\/span><\/li>\n<li><span style=\"color: #000000;\">Password &#8211; tiger<\/span><\/li>\n<li><span style=\"color: #000000;\">Host &#8211; localhost<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">Sartaj, now wants to display the records of students whose fee is more than 5000. Help Sartaj to write the program in Python.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Class 12 Computer Science Sample Paper with Explained Solution Session: 2023-24 Computer Science (083) Sample Question Paper (Theory) Time allowed: 3 Hours Maximum Marks: 70 \u00a0General Instructions: Please check this question paper contains 35 questions. The paper is divided into 4 Sections- A, B, C, D and E. Section A, consists of 18 questions (1 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,20],"tags":[],"class_list":["post-4192","post","type-post","status-publish","format-standard","hentry","category-cbse-sample-papers-class-12","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/4192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=4192"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/4192\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=4192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=4192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=4192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}