Add number to Seven segment Display when darkness is detected

In fact in regard to "state change", using a LDR, you will need to use analogRead to monitor the general level of illumination and respond (only) to relatively rapid (occurring over a couple of seconds) changes.

Connect the LDR from an analog input (other than A6 or A7 on the Nano) to ground and use INPUT_PULLUP on that pin.