In the title you talk about class, but there is no OOP/class in your code, i.e. it's not very clear what you are asking/what you have problem with....
In your code you use
Looking closer at your code - on line 47 you need to assign what you return from your function to some variable in order ti use these values further in the code, e.g.
In your code you use
return
to pass value from function to outside scope and that is the correct way to do... Maybe elaborate further on what you are struggling with...Looking closer at your code - on line 47 you need to assign what you return from your function to some variable in order ti use these values further in the code, e.g.
temp_c, temp_f = read_temp() #unpack the tuple returned by the function into two variables. I use the names you use later in the codeNote that you may want to do this first and then print these variables, instead of calling the function twice (on lines 45 and 47)...
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs