利用公式C=5/9x(F-32) 存华氏温度转项成選氏温度,并产生一张华氏0~300度与对应的宴氏温度之间的对照表 (每两30度输出一次)
时间: 2024-05-09 09:18:42 浏览: 13
首先,将公式中的F用x表示,得到公式x=(9/5)C+32,然后使用Python代码生成对照表:
```python
for fahrenheit in range(0, 301, 30):
celsius = (5/9) * (fahrenheit - 32)
kelvin = celsius + 273.15
print(f"Fahrenheit: {fahrenheit}°F = Celsius: {celsius:.2f}°C = Kelvin: {kelvin:.2f}K")
```
输出结果如下:
```
Fahrenheit: 0°F = Celsius: -17.78°C = Kelvin: 255.37K
Fahrenheit: 30°F = Celsius: -1.11°C = Kelvin: 272.04K
Fahrenheit: 60°F = Celsius: 15.56°C = Kelvin: 288.71K
Fahrenheit: 90°F = Celsius: 32.22°C = Kelvin: 305.37K
Fahrenheit: 120°F = Celsius: 48.89°C = Kelvin: 322.04K
Fahrenheit: 150°F = Celsius: 65.56°C = Kelvin: 338.71K
Fahrenheit: 180°F = Celsius: 82.22°C = Kelvin: 355.37K
Fahrenheit: 210°F = Celsius: 98.89°C = Kelvin: 372.04K
Fahrenheit: 240°F = Celsius: 115.56°C = Kelvin: 388.71K
Fahrenheit: 270°F = Celsius: 132.22°C = Kelvin: 405.37K
Fahrenheit: 300°F = Celsius: 148.89°C = Kelvin: 422.04K
```
相关推荐
![c](https://img-home.csdnimg.cn/images/20210720083646.png)
![c](https://img-home.csdnimg.cn/images/20210720083646.png)
![c](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)