A. 1) Write a Python Program read a text file line by line and display each word separated by a #.(4) OR Define a function print Pattern (line), which can print the given pattern. (4) If value of line is 3, then function can print a pattern like # ## ### 2) Create a python program to create a stack of student’s marks . (4) Write function PUSH to add marks in to the stack and Write function POP to remove the marks from stack and display the same. B. Complete the following database connectivity program by writing missing statements and perform the given query. (4) import ______________________________ as sqltor #1 mycon = sqltor.________( host = “localhost”, user = “root”, passwd = “123”, database = “medicine” ) #2 cursor = mycon.cursor( ) cursor.execute(______________________ ) #3 data = cursor._________________ #4 for rec in data: print ( rec ) mycon.close( ) a. Complete the statement #1,by writing the name of library / package need to import for database connectivity. b. Complete the statement #2, write the name of method require to create connection between python and mysql. c. Complete the statement #3, write the query to display those drug records which price is between the 50 to 100 from table DRUG. d. Complete the statement #4, to retrieve all records from the result set.
Q.2 Report/Practical File (7)
Q.3 Project (8) Q.4 Viva voce (3)
External Examiner Internal Examiner
Name : _____________________ Name : ______________________