Use the mapping get method to read a value by key without failing when that key is absent. It returns the stored value when present; otherwise it returns None, or a default you provide. This makes optional configuration and partially mapped input safe to handle. section 3.5 section 7.5.3
Keep motor calibration optional
Motor adjustments can come from environment variables while still allowing the robot to run with neutral power. Convert the result after get returns either the configured string or the fallback value. DC_ADJUST_R = float(os.environ.get('ROBO_DC_ADJUST_R', '1')) DC_ADJUST_L = float(os.environ.get('ROBO_DC_ADJUST_L', '1')) If no adjustment is set, each motor uses 1; if an adjustment is set, such as 0.8, that value is used instead. section 3.5
>>> os.environ.get('ROBO_DC_ADJUST_L', '1')
'1'
>>> os.environ.get('ROBO_DC_ADJUST_R', '1')
'0.8'
Compare an absent left-motor variable with a configured right-motor variable: the same get call supplies a usable value in both cases. section 3.5
Ignore unmapped joystick controls
Use get when only selected buttons and axes have names. An event number outside the mapping produces None rather than an error, so the event can still be printed or handled safely. name = BUTTON.get(event.number) The same pattern retrieves axis names from AXIS. section 7.5.3
Do not confuse mapping get with the HTTP GET method. HTTP GET is used for web-service calls that do not change robot state, while movement requests use POST. section 5.5

