Latest web development tutorials

A su vez Python Celsius Fahrenheit

Documento de Referencia de objetos Ejemplos python3

Los siguientes ejemplos muestran cómo activar Fahrenheit a Celsius:

# -*- coding: UTF-8 -*-

# Filename : test.py
# author by : www.w3big.com

# 用户输入摄氏温度

# 接收用户收入
celsius = float(input('输入摄氏温度: '))

# 计算华氏温度
fahrenheit = (celsius * 1.8) + 32
print('%0.1f 摄氏温度转为华氏温度为 %0.1f ' %(celsius,fahrenheit))

Ejecutar los resultados de la salida el código de seguridad:

输入摄氏温度: 38
38.0 摄氏温度转为华氏温度为 100.4 

El ejemplo anterior, a su vez Celsius Fahrenheit fórmula centígrados * 1,8 = Fahrenheit - 32. Así se obtiene la siguiente fórmula:

celsius = (fahrenheit - 32) / 1.8

Documento de Referencia de objetos Ejemplos python3