week5.py - import time list_member = list class Softball...

This preview shows page 1 - 3 out of 3 pages.

import time list_member = list() class Softball: def addMembers(): dict = {} name = input("Enter name: "); name = str(name) contact = input("Enter contact: "); contact = str(contact) jno = input("Enter jersey: "); jno = int(jno) dict["name"] = name dict["contact"] = contact dict["jersey"] = jno list_member.append(dict) print("Added Successfully") time.sleep(1) def displayList(): print('The current members list:') for memb in list_member: print(memb) time.sleep(2) def rmMember(i): for member in list_member: if member["name"] == i: j = list_member.index(member)
del list_member[j] print('Deleted Successfully') time.sleep(1) def modify(i): dict = {} i = int(i) nam = input("enter modified name\n") nam = str(nam) cont = input("enter modified contact\n") cont = str(cont) jno = input("enter modified jersey no\n")

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture