old_contents: import NDIR
  import time
  
  sensor = NDIR.Sensor(0x4D)
  sensor.begin()
  
  while True:
      sensor.measure()
      print("CO2 Concentration: " + str(sensor.ppm) + "ppm")
      time.sleep(1)
  
new_contents: import NDIR
  import time
  
  sensor = NDIR.Sensor(0x4D)
  
  if sensor.begin() == False:
      print("Adaptor initialization FAILED!")
      exit()
  
  while True:
      if sensor.measure():
          print("CO2 Concentration: " + str(sensor.ppm) + "ppm")
      else:
          print("Sensor communication ERROR.")
  
      time.sleep(1)
  
subject: Make use of the return value of begin() and measure()