Oct-26-2020, 11:10 PM
In your changed version, on line 5: temperature.replace() doesn't modify temperature. It returns the modified string. If you don't assign it to something (like temperature), the replacement is lost.
temperature.replace("F", "") # this is a noop because the replaced string is not captured anywhere