Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Pls Create a class called Table. Please Do question 1 - 4 class Table: 1) def __init__ 2) def add_record 3) def __call__ 4)
Python Pls
Create a class called Table.
Please Do question 1 - 4
class Table:
1) def __init__
2) def add_record
3) def __call__
4) def __getitem__
Define a class named Table in a module named table.py 0. Note that the module already includes the correctly written_str_and raw methods illustrated above, which you may use for printing/debugging. You may define additional (helper) methods in this class (but not functions in the module), but you do not have to define any, I didn't. You can write your own simple code to test your class in its script, and/or use the tests in the script or the large bsc.txt file tests supplied with the project. If you want to better see the exceptions raised, and their messsages, in the bsc.txt tests, uncomment the code before the call to driver.driver(). 1. Define an _init_method that has three parameters: 1. The name of the Table (a str) 2. The fields of the Table (a list of str) 3. The checks of the Table (a list of functions or lambdas) Important: You must store this information in the attibutes named self.name, self.fields, and self.checks. Also, you must bind the attribute named self.records to an empty list. Many batch self-check tests refer to these four attribute names directly, they will fail if you do not name these attributes correctly. The original Table above could be specified (initially, without any records) by the following call. employee - Table ("Employee', 'Name','EmpId', 'DeptName'], (lambda v: type (v) is str, lambda v: type (v) is int and 1000 at Ox021C44B0>,Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started