Python task3 error

Screenshot from 2024-09-23 15-45-10


im getting this error and even my score is not updating and i dont know whats the reason for the error

from robot_control_class import RobotControl

class ExamControl:

def __init__(self):
    self.rc = RobotControl()  
    a = self.rc.get_laser(360)
    while a > 1:
        self.rc.move_straight()
        a = self.rc.get_laser(360)
    self.rc.stop_robot()
    self.rc.turn("clockwise", 0.3, 5)

def get_laser_readings(self):
    a = self.rc.get_laser(0)    
    b = self.rc.get_laser(719)
    return b , a     

def main(self):
    self.rc.move_straight()
    while True:
        right = self.rc.get_laser(0)
        left = self.rc.get_laser(719)
        if (right == float("inf")) and (left == float("inf")):
            break
    self.rc.stop_robot()

Hi, does your code work as expected when you run it?

This might mean that your program enters an infinite loop and never exits, and thus the grader can’t continue.

Adding to what @roalgoal said, can you run the following successfully, within 10 seconds?

python task3_correct.py

To see if it runs within 10 seconds, please run

timeout 10s python task3_correct.py

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.