{"id":946,"date":"2021-06-09T13:14:01","date_gmt":"2021-06-09T07:44:01","guid":{"rendered":"https:\/\/cbsepython.in\/?p=946"},"modified":"2024-02-26T19:54:37","modified_gmt":"2024-02-26T14:24:37","slug":"computer-science-practical-question-paper","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/computer-science-practical-question-paper\/","title":{"rendered":"CBSE Computer Science Practical Question Paper Sample"},"content":{"rendered":"<h3><span style=\"color: #000000;\">Computer Science Practical Question Paper Sample<\/span><\/h3>\n<p><span style=\"color: #000000;\">A.I.S.S.C.E. Practical Examination<\/span><\/p>\n<p><span style=\"color: #000000;\">Subject: Computer Science (083)<\/span><\/p>\n<p><span style=\"color: #000000;\">Time 3 Hrs\/MM:30<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET- 1<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- Write a program to input a list and interchange first with last, second with second last &#8230;. Print the list in reverse order.(7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and increase the fees by 1000 of section A students of table CBSE21 ( which is already stored in test database).(5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute(\"update dma23 set fees=fees+1000 where sec='A'\")\r\nmycon.commit()\r\n\r\n'''\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 2<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- Write a program \u00a0to input a list and replace every even element with its half and odd with double. (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display name , fees and new fees where new fees is 100 + fees \u00a0in \u00a0table CBSE21 ( which is already stored in test database).(5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute(\"SELECT NAME,FEES,FEES+100 FROM DMA23\")\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 3<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- Write a program\u00a0 to input a list and interchange its alternate elements 1,2,3,4,5,6-&gt; 2,1,4,3,6,5 (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display how many students in section C\u00a0 from\u00a0\u00a0 table CBSE21 ( which is already stored in test database). (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute(\"select count(*) from dma23 where sec='c'\")\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 4<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- Write a program \u00a0to input a list and replace\u00a0 all those numbers with their next list element which are divisible by 3.<\/span><\/p>\n<p><span style=\"color: #000000;\">3 4 6 1 2 3 8= 4 4 1 1 2 8 8 (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display how many students in each section where strength is more then 2 from\u00a0\u00a0 table CBSE21 ( which is already stored in test database).(5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute(\"select sec,count(*) from dma23 group by sec having count(*)&gt;2\")\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 5<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- WRITE A PROGRAM to input a list of numbers and print its largest , smallest\u00a0 with their index. (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">Input-&gt;How many elements- 6<\/span><\/p>\n<p><span style=\"color: #000000;\">Enter elements 19,34,24,89,45,12<\/span><\/p>\n<p><span style=\"color: #000000;\">Largest \u2013 89 index 3<\/span><\/p>\n<p><span style=\"color: #000000;\">Smallest &#8211;\u00a0 12 index 5<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display names of students whose name length is only 4 from\u00a0\u00a0 table CBSE21 ( which is already stored in test database). (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute('select name from dma23 where name like \"____\"')\r\nfor x in mycursor:\r\n    print(x)\r\n\r\n\r\n'\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4-Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5-Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 6<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- Create a function to take a number as argument return 1 if number is prime , return 0 if number is not prime. Call this function to print prime number between 5 to 50. (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display all data of A section students \u00a0from table CBSE21 ( which is already stored in test database) (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute('select * from dma23 where sec=\"A\" ')\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File( 7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 7<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- WRITE A PROGRAM to read a text file &#8220;ab.txt&#8221; and count how many \u201che \u201c and \u201cshe\u201d are there. ( 7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display how many students in section A and their average fees from\u00a0\u00a0 table CBSE21 ( which is already stored in test database). (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute('select count(*),avg(fees) from dma23 where sec=\"A\" ')\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 8<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- WRITE A PROGRAM to read a text file my.txt and count how many upper case character and how many lower case character are there. (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display names which are ending with \u2018N\u2019 \u00a0in alphabetical order table CBSE21 ( which is already stored in test database). (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute('select name  from dma23 where name like \"%N\" order by name')\r\nfor x in mycursor:\r\n    print(x)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva( 3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 9<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- WRITE A PROGRAM to read a\u00a0 text file\u00a0 and count how many vowels(both case) are there. (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and \u00a0insert\u00a0 a new record (18,\u201dDev\u201d, 8978,\u2019A\u2019 115, 1400) in \u00a0\u00a0table CBSE21 ( which is already stored in test database).(5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nR=[]\r\nN=[]\r\nAD=[]\r\nS=[]\r\nT=[]\r\nF=[]\r\nI=0\r\nR.append(18)\r\nN.append(\"Dev\")\r\nAD.append(8978)\r\nS.append('A')\r\nT.append(115)\r\nF.append(1400)\r\nmycursor.execute(\"INSERT INTO CBSE21(rollno,name,admn,sec,tid,fees) VALUES({},'{}',{},'{}',{},{})\".format(R[I],N[I],AD[I],S[I],T[I],F[I]))\r\nmycon.commit()\r\nprint(mycursor.rowcount,\"RECORD INSERTED\")\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File ( 7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"color: #000000;\">SET 10<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">1- WRITE A PROGRAM to create a dictionary to store name, roll no and admission number\u00a0 and store this dictionary in a binary file my.dat for five students . (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">2- Write a program to create interface with MySQL database and display number of students, fees total\u00a0 for each section from\u00a0\u00a0 table CBSE21 ( which is already stored in test database). (5 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n<table width=\"384\">\n<tbody>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">ROLLNO<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0NAME<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ADMN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SEC<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0TID<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0FEES<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">1<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJAY<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1234<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1000<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">2<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0AJEEM<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">3<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SHREE<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1219<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">4<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAVI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1216<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">115<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1250<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">5<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0SOHAN<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">2212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">119<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1300<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">6<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0ARSH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">112<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">7<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RISHI<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1230<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0C<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">130<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">8<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0CHIRAG<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1290<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">187<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1100<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">9<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0VINAYAK<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1345<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0B<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">213<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1600<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"64\"><span style=\"color: #000000;\">10<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0RAJNEESH<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">4212<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">\u00a0A<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">111<\/span><\/td>\n<td width=\"64\"><span style=\"color: #000000;\">1200<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#python -m pip install mysql-connector-python\r\n#install it from python directory \r\nimport mysql.connector\r\nmycon=mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"100\",database=\"test\")\r\nif(mycon.is_connected):\r\n    print(\"python connected  with SQL \")\r\nelse:\r\n    print(\"not connected with SQL\")\r\nmycursor=mycon.cursor()\r\nmycursor.execute('select sec,count(*),sum(fees) from cbse21 group by sec')\r\nfor x in mycursor:\r\n    print(x)\r\n\r\n''<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">3- Project (8 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">4- Practical File (7 marks)<\/span><\/p>\n<p><span style=\"color: #000000;\">5- Viva (3 marks)<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Computer Science Practical Question Paper Sample A.I.S.S.C.E. Practical Examination Subject: Computer Science (083) Time 3 Hrs\/MM:30 &nbsp; SET- 1 1- Write a program to input a list and interchange first with last, second with second last &#8230;. Print the list in reverse order.(7 marks) 2- Write a program to create interface with MySQL database and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-946","post","type-post","status-publish","format-standard","hentry","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/946","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=946"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/946\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}