Best way to program many changing conditions

Trying to write a program to do the following via Python on a Raspberry pi.
I am used to programming in Visual Basic, find it difficult in Python with no GOTO/select.
Have tried with “while loops” and now using “if-elif-else”.

Any suggestions on how to achieve it .

Thanks David.

Control of electric heaters in central heating system supplied from the Solar PV panels.

Have 4 heaters to turn on.

I need to turn on 1 then check – Power_result (tests whether grid or battery power is being used)
If True turn off, if False leave heater on
Repeat for other 3 heaters.

If not all 4 on keep checking, and turn on/off as required

Need to monitor Power_Result all the time
so as to turn some heaters off if True.

Why is an if/elif/else construct not working for you?

Do you have code to share that we could see and offer advice on?

You could model this with a Heater class and have one instance for each of your heaters.

Then you could put all the heaters in a list and loop over the list to turn them all off.