# Smart Home Automation System
# Kenaz Mohammed Salem Saeed - Student ID: 251001922

def show_menu():
    print("\n----- Smart Home Automation System -----")
    print("1. Turn On/Off Lights")
    print("2. Set Temperature")
    print("3. Arm/Disarm Security System")
    print("4. Show System Status")
    print("5. Exit")

def toggle_lights(state):
    return not state

def set_temperature(current_temp, min_temp=16, max_temp=30):
    try:
        temp = float(input(f"Enter temperature between {min_temp} and {max_temp}°C: "))
        if min_temp <= temp <= max_temp:
            print(f"Temperature set to {temp}°C")
            return temp
        else:
            print("Error: Temperature out of allowed range.")
            return current_temp
    except ValueError:
        print("Error: Please enter a valid number.")
        return current_temp

def toggle_security(state):
    return not state

def show_status(lights, temperature, security):
    print("\n----- Current System Status -----")
    print(f"Lights: {'On' if lights else 'Off'}")
    print(f"Temperature: {temperature}°C")
    print(f"Security System: {'Armed' if security else 'Disarmed'}")
    print("-------------------------------\n")

def main():
    lights = False
    temperature = 22.0  # Default temperature
    security = False
