Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function help
#1
def my_room_light_on():
    my_room_l_on = b.set_light([1, 2, 9, 10], 'on', True)
    my_room_l_off = b.set_light([1, 2, 9, 10], 'on', False)
    if 'on' in text:
        my_room_l_on
            return True
    elif 'off' in text:
        my_room_l_off
            return True
    return False
what would be the right way to write this i'm trying to return a command that would be in input with out having to make a whole bunch of functions trying to condense them. basically if on is in text I want it to return my_room_l_on if off is in text have it return the off variable.
Reply


Messages In This Thread
Function help - by Nickd12 - Sep-15-2020, 01:01 AM
RE: Function help - by bowlofred - Sep-15-2020, 01:23 AM
RE: Function help - by Nickd12 - Sep-15-2020, 01:32 AM
RE: Function help - by buran - Sep-15-2020, 04:43 AM
RE: Function help - by bowlofred - Sep-15-2020, 04:44 AM
RE: Function help - by Nickd12 - Sep-15-2020, 06:59 AM
RE: Function help - by buran - Sep-15-2020, 07:09 AM
RE: Function help - by Nickd12 - Sep-15-2020, 07:09 AM
RE: Function help - by buran - Sep-15-2020, 07:13 AM
RE: Function help - by Nickd12 - Sep-16-2020, 07:24 PM
RE: Function help - by buran - Sep-16-2020, 07:32 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020