我只是在玩 Python,非常基本的东西。
逻辑如下:
- 用户提供 3 摄氏度的温度,
 - 模块的主体计算他们的华氏当量,
 - 并将它们作为输出打印出来。
 
我想为这个任务使用 for 循环。
def main():
    c1, c2, c3 = input("Provide 3 Celsius temps. separated with a comma: ")
    for i in range(c1, c2, c3):
        fahrenheit = (9.0 / 5.0) * i + 32
        print "The temperature is", fahrenheit, "degrees Fahrenheit."
main()
好吧,上面的代码只翻译和打印用户提供的第一个 Fahrenheit tempatarute。
请提供一些提示。