我需要帮助。我试图让我的 for 循环使用小数,但我的代码不接受浮点数,我不确定下一步该怎么做。谁能指出我哪里出错了?
它是用于按用户定义的步骤 (Delta) 将摄氏温度转换为华氏温度的代码。这里是:
def main():
# Handshake
print("This program will convert a range of Celsius degrees to")
print("Fahrenheit degrees based on your input.")
# Ask and read low end of range
Rangelow = eval(input("Enter the low end of your range: "))
# Ask and read top end of range
Rangehigh = 1 + eval(input("Enter the high end of your range: "))
# Ask and read Delta
Delta = eval(input("Enter the Delta for your range: "))
#Display output …Run Code Online (Sandbox Code Playgroud)