PYTHON STACKS LINK : PYTHON STACKS - NOTES Menu-Driven Stack Program # -*- coding: utf-8 -*- """ Created on Sun Oct 12 17:19:01 2025 @author: Kirti Hora """ ''' Menu-Driven Stack Program 1.PUSH 2.POP 3.DISPLAY 4. DISPLAY EVEN ''' def push(stack): elements = input("Enter elements to push (separated by spaces): ").split() for item in elements: n = int(item) stack.append(n) print("Element pushed:", n) print("Current Stack:", stack) def pop(stack): if len(stack) == 0: print("Stack Underflow! Stack is empty.") else: n = stack.pop() print("Deleted Element:", n) def disp(stack): if len(stack) == 0: print("Stack Underflow! Stack is empty.") else: print("Stack elemen...
# -*- coding: utf-8 -*- """ Created on Thu Aug 14 13:21:08 2025 @author: Kirti Hora """ import csv def createcsv(): filename = "emp.csv" with open(filename, "w", newline="") as csv_fobj: wtr_obj = csv.writer(csv_fobj) wtr_obj.writerow(["Empno", "Name", "Basic Salary", "Allowance", "Deduction", "Net Salary"]) while True: eno = input("Enter employee no: ") name = input("Enter name: ") bs = float(input("Enter basic salary: ")) allowance = 2000 dedn = bs * 0.05 net = bs + allowance - dedn wtr_obj.writerow([eno, name, bs, allowance, dedn, net]) ...