create class name treatment using functions in python TREATM

create class name treatment using functions in python

TREATMENT CLASS: The treatment class has no methods, just two attributes which must be given when a treatment object is created. The name attribute stores the name of the treatment as a string. The cost attribute stores the cost of the treatment as a number.

Solution

Here is the code for your class:

#!/usr/bin/python
class Treatment :
def __init__(self, name, cost) :
self._name = name
self._cost = cost

treatment1 = Treatment(\'Myname\', 12.50)

create class name treatment using functions in python TREATMENT CLASS: The treatment class has no methods, just two attributes which must be given when a treatm

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site