Question: #there are you error in the program I need the correct one# a.There are four errors in the following program that will prevent it from

  • #there are you error in the program I need the correct one#

  • a.There are four errors in the following program that will prevent it from running as intended. For each error, state what the error is and give the correct Python statement.

    (8 marks)

    1 %%sim_magic -b Coloured_bands

  • 2 # Drive Forward and Stop at Pure Green

  • 3

  • 4

  • # 5 from ev3dev2.motor import MoveSteering, OUTPUT_B, MOTOR_C

  • 6 from ev3dev2.sensor import INPUT_1, INPUT_2, INPUT_3, INPUT_4

  • 7 from ev3dev2.sensor.lego import ColorSensor

  • 8

  • 9

  • # 10 colorLeft = ColorSensor(INPUT_2)

  • 11

  • 12

  • # 13 steering_drive = MoveSteering(OUTPUT_B, OUTPUT_C)

  • 14 steering_drive.on(direction, 20)

  • 15

  • 16

  • # 17 if colorLeft.rgb[0]==0 and colorLeft.rgb[1]==1 and colorLeft.rgb[2]==0:

  • 18 print('Left RGB: ' + str(colorLeft.rgb))

  • 19

  • 20 # Explicitly stop motors at end of program 21 steering_drive.off()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!