Error in Telegram Project code execution

Hi there! I just received this error while trying to execute my code for the Telegram project:

I tried executing the code without the ‘continue’, and ended up getting blocked from API access because the loop wouldn’t terminate after I pressed CTRL+C.

Here’s the code:



I’m a little sceptical of further trying to rectify the code on my own, so I’d appreciate some guidance ASAP. Thanks in advance!

@shilpa.namboodiri

The if conditions inside the while loop are not properly indented.
Please indent them so that they will be considered to be part of the while loop.

You can follow indentation pattern

while True:
    sensor_value...
    print(...
    if sensor_value == -999:
        print(...
        time..
        continue
    
    if sensor_value>..
        print(...
        .
        .
        .

    time.sleep(30)

The solution worked. Thank you.

1 Like