
s = the distance traveled
v = the velocity of sound
t = the time taken
Lightning and thunder are produced simultaneously, but the thunder is heard a few seconds after the lightning is seen. This is because the speed of light in air is more than the speed of sound in air.
The speed of sound is 340 m/s. Thus, the entire time of 10 seconds (as mentioned in the question) between seeing the light and hearing the thunderstorm is taken by the sound to travel to the observer. Hence, the distance traveled by the thunder is given as follows.

Thus, the distance traveled by the thunder is 3.4km.