Hello again!
Could someone explain to me the below example?
def add(a=2,b=2):
res = a + b
return res
r = add(3,4)
print (r)
I can’t understand why the writer uses the return statement?
Also, I can’t understand the below exercise
from robot_control_class import RobotControl
robotcontrol = RobotControl(robot_name="summit")
def get_laser_values(a,b,c):
r1 = robotcontrol.get_laser_summit(a)
r2 = robotcontrol.get_laser_summit(b)
r3 = robotcontrol.get_laser_summit(c)
return [r1, r2, r3]
l = get_laser_values(0, 500, 1000)
print ("Reading 1: ", l[0])
print ("Reading 2: ", l[1])
print ("Reading 3: ", l[2])