China Naming Network - Fortune telling knowledge - There is an error in the code for obtaining weather forecast using python, please solve it

There is an error in the code for obtaining weather forecast using python, please solve it

The previous answer is concise enough.

First, find the number of lines of code that cause the problem.

Secondly, find the variable that is causing the problem.

When you print(type(variable name))?, you can find that the variable is of str? string type and cannot participate in calculations, so you should convert it into a numerical type, generally using float. (variable name)? to convert, after changing the line that reported the error, there is basically no need to change anything else.

Personal suggestions:

1. Your Python? foundation seems to be a bit weak, it is best to learn the basics. Other modules require this foundation for better use.

2. Maybe you can take a look at pandas. Sometimes using pandas for data analysis can save a lot of code. Especially for people who have just learned python, it may be easier to accept the unique syntax of pandas.

The wealth value, if any, should be given to the person who answered the question above. Because his answer is correct.