In your project Module3, test folder, make a Python unit test operators_practice.py
Write tests to understand the operators
import unittest
class OperatorsTest(unittest.TestCase): def test_equal(self): self.assertFalse(5 == 5)
if __name__ == '__main__': unittest.main()
Run the test and see the Fail.
Fix it to Pass, then write tests for the other 6 operators.
import unittest
class OperatorsTest(unittest.TestCase): def test_equal_operator(self): a = 7 b = -2 self.assertFalse(a == b) def test_notequal_operator(self): a = b = self.assert #continue...
Once all your test Pass, take a screenshot.
Note this is not a useful program for the world, just a nice way to practice some unit test and learning the operators.
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.