Session 4
Objective
-
Write a Qualean class that is inspired by Boolean+Quantum concepts. We can assign it only 3 possible real states. True, False, and Maybe (1, 0, -1) but it internally picks an imaginary state. The moment you assign it a real number, it immediately finds an imaginary number random.uniform(-1, 1) and multiplies with it and stores that number internally after using Bankers rounding to 10th decimal place.
-
It implements these functions (with exactly the same names)
__and__, __or__, __repr__, __str__, __add__, __eq__, __float__,
__ge__, __gt__, __invertsign__, __le__, __lt__, __mul__, __sqrt__,
__bool__
- Write a test file, that tests all of the functions mentioned above + the other basic ones
- Test file must contain at least 25 tests
Files
- Test File : PyTest file
- Code: Method Implemantation
- colab File:
Test Cases Results
Serial No | Test Case | Result |
---|---|---|
1 | README File Exists | Pass |
2 | RREADME Words Counts | Pass |
3 | README proper description | Pass |
4 | RREADME Formatting | Pass |
5 | Proper identation and PEP8 guidelines | Pass |
6 | Function name not defined with capital letters | Pass |
7 | repr proper implementation | Pass |
8 | str proper implementaton | Pass |
9 | lt implementation check | Pass |
10 | le implementation check | Pass |