Skip to main content

Posts

Showing posts from August, 2020

DSL A4

Data Structure Lab : Practical A4 :   Write a Python program that computes the net amount of a bank account based a transaction log from console input. The transaction log format is shown as following: D 100 W 200 (Withdrawal is not allowed if balance is going negative. Write functions for withdraw and deposit) D means deposit while W means withdrawal. Suppose the following input is supplied to the program: D 300, D 300 , W 200, D 100 Then, the output should be: 500 The code for above problem is as follows : #@author: Vedant print(""" HELLO WELCOME TO OUR BANK""") balance=0 def deposit(): global balance while True: amount=float(input("Enter amount to be Deposited: ")) balance += amount print("\n Amount Deposited:",amount) res=input ("Do you want to Deposite more money? y or n ")

DSL A3

Data Structure Lab : Practical A3 :   Write a Python program for department library which has N books, write functions for following:  a) Delete the duplicate entries  b) Display books in ascending order based on cost of books  c) Count number of books with cost more than 500.  d) Copy books in a new list which has cost less than 500. #@author: Vedant n=int(input("Enter Total no. of Books in your Library ")) bn=[] #Book No. list bp=[] #Book Price list for i in range(n): c=int(input("Enter the Book NO. ")) print("Enter the price of Book NO.",c) p=int(input()) bn.append(c) bp.append(p) print("List of your Books",bn) print("List of prices of your Books\n",bp) print("<><><><><><><> Solutions Are as follows <><><><><><><><><>") # Delete the duplicate entries in

DSL A2

  Write a Python program to store marks scored in subject “Fundamental of Data Structure” by N students in the class. Write functions to compute following:  a) The average score of class  b) Highest score and lowest score of class  c) Count of students who were absent for the test  d) Display mark with highest frequency The Code for above problem is as follows : """ @author: SPPU SE GURU """ total=int(input ("Enter total no. of students in your class ")) pre=int(input("No. of students appeared for FDS exam : ")) U=[] for i in range (total): i=i+1 U.append(i) R=[] for i in range(pre): roll=int(input("Enter Roll no. of students present for test :- ")) R.append(roll) M=[] for i in range(pre): print("Enter Roll no. ",R[i],end=" ") marks=int(input("Marks:- ")) M.append(marks) print("********** Solutions Are as fo

DSL A1

Hello Friends lets See the first practical of Data Structure Laboratory(DSL) of SPPU Second Year. Some of the students are afraid of coding as it is new to all of us. So we are here to conquer your fear. You will find it easy as it explained by students only. So lets Get into it The first practical of part A is : In second year computer engineering class, group A student’s play cricket, group B students play badminton and group C students play football. Write a Python program using functions to compute following: -  a) List of students who play both cricket and badminton  b) List of students who play either cricket or badminton but not both  c) Number of students who play neither cricket nor badminton  d) Number of students who play cricket and football but not badminton.  (Note- While realizing the group, duplicate entries should be avoided, Do not use SET built-in functions)  So most of us know the SET theory in mathematics. The above problem is very easy if you have knowledge about