Question: 1 . Create a Python class named 'TemperatureConverter' with the following attributes and methods: a . Attributes: - _ _ celsius ( float ) b
Create a Python class named 'TemperatureConverter' with the following attributes and methods:
a Attributes:
celsius float
b Methods:
initself celsius: Constructor to initialize the attribute.
Parameters: celsius float
Set the initial temperature in Celsius using the provided value.
settemperatureself celsius: Setter method to update the temperature.
Parameters: celsius float
Update the value of celsius with the provided temperature.
gettemperatureself: Getter method to retrieve the temperature in Celsius.
Return the value of celsius.
Outside the class, create an instance of 'TemperatureConverter'.
a Set the initial temperature to using the constructor.
b Use the 'settemperature' method to update the temperature to
c Print the current temperature using the 'gettemperature' method
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
