Python函数没有运行

时间:2016-01-30 01:08:45

标签: python function

import math 
import sys 
import random
import __main__

print "Home Temp Assist"
print "Loading......."
print "Testing Pro Type 1 What is your Temp???"

user_input = input()

on = 1 
off = 0
auto = True
a_c = (on, off, auto)
temp = "user_input"

heat = (on, off)

print "Temperature is measured in Degrees F"
set_temp = range(60, 100)
print "you are here [1]"
def Turn_On(n):
    Heat = 1
    print "your Heat is on"

def Room_Temp(n):
    if temp < 75:
        Turn_On = True
        set_temp = 75
        print "Your Temperature has been set to 75"
    else:
        Temp < 75 
        print "Room needs to cool down"

print " you are here [2] "



def Turn_Off(n):
    Heat = 0 
    Fan = 0

print "you are here [3]"

我的Room_Temp功能出错了。当我运行代码并输入临时没有任何反应。有什么建议吗?

1 个答案:

答案 0 :(得分:-1)

您也从未在定义函数中定义了值'n' def Room_Temp(n): 值'n'未定义。