Distance: the lightning and the thunder are produced at the same instant. Treating the flash as seen at once, the 4.5 s delay is the time the sound takes to travel the distance d:
d=vt=343×4.5=1543.5 m≈1.54 km
Why the light's travel time can be ignored: light travels at about 3.0×108 m s−1, so it covers this distance in
tlight=3.0×1081543.5=5.1×10−6 s
This is about 5 microseconds, roughly a millionth of the 4.5 s delay. Treating the flash as reaching us instantly makes no noticeable difference to the answer.