



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
term 1 answer key with this you can practice
Typology: Exercises
1 / 7
This page cannot be seen from the preview
Don't miss anything!




General Instructions: This question paper contains 37 questions. All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions The paper is divided into 5 Sections- A, B, C, D and E. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks. All programming questions are to be answered using Python Language only. In case of MCQ, text of the correct answer should also be written. SECTION – A Q No. Section-A (21 x 1 = 21 Marks) Marks
add() c= print(c,end='%') (A) 12%15# (B) 15#12% (C) 12#15% (D) 12%15#
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as: (A) Both A and R are true and R is the correct explanation for A (B) Both A and R are true and R is not the correct explanation for A (C) A is True but R is False (D) A is False but R is True
Q No. Section-C ( 3 x 3 = 9 Marks) Marks
What will be the output of following code? def Fun1(mylist): for i in range(len(mylist)): if mylist[i]%2==0: mylist[i]/= else: mylist[i]*= list1 =[21,20,6,7,9,18,100,50,13] Fun1(list1) print(list1)
Vedika has created a dictionary containing names and marks as key-value pairs of 5 students. Write a program, with separate user-defined functions to perform the following operations:
The details (RollNo, Name, Clas and Marks) are to be accepted from the user. Write the following missing statements to complete the code: Statement 1 – to form the cursor object Statement 2 – to execute the command that inserts the record in the table Student. Statement 3- to add the record permanently in the database import mysql.connector as mysql def sql_data(): con1=mysql.connect(host="localhost",user="root",password="tiger",database="school" ) mycursor=_________________ #Statement 1 rno=int(input("Enter Roll Number :: ")) name=input("Enter name :: ") clas=int(input("Enter class :: ")) marks=int(input("Enter Marks :: ")) querry="insert into student values({},'{}',{},{})".format(rno,name,clas,marks) ______________________ #Statement 2 ______________________ # Statement 3 print("Data Added successfully") ************************ ALL THE BEST **************************