CLASS 12 - COMPUTER SCIENCE - ASSIGNMENT
DATA STRUCTURE
1) Write a program to input 2 lists and define a function to check if both the lists are
sorted in ascending order, descending order, no order. The function has to return
1 if it is in ascending, 0 if it is in descending, otherwise -1.
2) Define the functions MakePush(Package) and MakePop(Package) to add a new
package and delete a package from a list of package description, considering
them to act as push and pop operations of stack data structure.
3) Define function PushCopies(String) that adds those words which occur more
than once in the String into a stack which is implemented as a [Link] define
Pop() to remove the topmost element and Peep() to display the topmost element
from the stack.
PYTHON INTERFACE
1) What is python’s database interface known as?
2) Explain the following ‘results’ retrieval methods- fetchone(), fetchall(), rowcount
3) ABC company is an insurance company that stores the details of its customers in
customer table with the fields - Policyno-int,Name-15 characters,policyname-15
characters,phno-int,Assured_amt - float , Premium- float,period-int(in years) .
Consider the following for database connectivity:
database-ABC , password-policy
Define following functions:
Insert() - That inputs all the above details and inserts a row in customer table.
Print() - That prints those records whose period is more than 5 years and
Assured amount is more than 500000.