a. What role do comments play in a computer program? To what extent do they influence the way in which code is executed and the outputs it produces? (3 marks)
b. In general terms, what are programming code functions, how are they constructed, and why might they be useful when creating your own robot control Python programs? (4 marks)
c. Define a function named value_comparator that can compare a value passed to it with a threshold value. The function should return the value True if the sensor value is greater than or equal to the threshold value; otherwise, it should return False. The function should set a default (optional parameter) threshold value of 25 if no threshold value is explicitly passed to it. Your answer should be run in a 'bare' code cell without using any simulator magic at the start of it. You should include the function code and examples of it being used:
- With a default threshold for values less than, greater than, and equal to the default set threshold.
- With an explicitly set threshold of 50 and values less than, greater than, and equal to that value. (5 marks)