Case study Based Questions - Quiz 1
Sign in to Google to save your progress. Learn more
Email *
Case Study #1
1. Rohit, a student of Class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete Python code (shown below) to create a CSV File ‘Student.csv’ (content shown below). Help him in completing the code which creates the desired CSV File. CSV File
1,AKSHAY,XII,A
2,ABHISHEK,XII,A
3,ARVIND,XII,A
4,RAVI,XII,A
5,ASHISH,XII,A
Incomplete Code
import_____                  #Statement 1
fh = open(_____, _____, newline=‘ ’)           #Statement 2
stuwriter = csv._____             #Statement 3
data = []
header = [‘ROLL_NO’, ‘NAME’, ‘CLASS’, ‘SECTION’]
data.append(header) for i in range(5):
roll_no = int(input(“Enter Roll Number : ”)) name = input(“Enter Name : ”)
class = input(“Class : ”)
section = input(“Enter Section : ”)
rec = [_____]                        #Statement 4
data.append(rec)
 
stuwriter._____ (data) #Statement 5
 fh.close()                

Identify the suitable code for blank space in line marked as Statement 1. *
1 point
Identify the missing code for blank space in line marked as Statement 2 *
1 point
Choose the function name (with argument) that should be used in the blank space of line marked as Statement 3. *
1 point
Identify the suitable code for blank space in line marked as Statement 4. *
1 point
Choose the function name that should be used in the blank space of line marked as Statement 5 to create the desired CSV file? *
1 point
Case Study 2
Which of the following commands is used to open the file “STUDENT.DAT” for writing only in binary format? (marked as #1 in the Python code) *
1 point
Which of the following commands is used to write the list L into the binary file ‘STUDENT.DAT’? (marked as #2 in the Python code) *
1 point
Which of the following commands is used to read each record from the binary file ‘STUDENT.DAT’? (marked as #3 in the Python code) *
1 point
Which of the following statement(s) are correct regarding the file access modes? *
1 point
Which of the following statements correctly explain the function of seek() method? *
1 point
Case Study 3
Input: location = “Chennai”, pay = 50000 *
1 point
Input: location = “Surat” ,pay = 50000 *
1 point
Input : location = “Any Other City”, pay = 1 *
1 point
Input : location = “Delhi”, pay = 50000 *
1 point
Input : location = “Lucknow”, pay = 65000 *
1 point
Submit
Clear form
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy