This week has seen some crazy temperatures with highs of almost 40C across the UK. While some parts of the UK, like London, are still seeing sunshine, other areas are now experiencing thunder and lightning. But why is it that we experience thunderstorms after hot weather?

According to the BBC, "thunderstorms start inside a cloud when it's high up in the atmosphere where the air is cooler than the air below it. Bits of ice move up and down and bump into each other inside the cloud. This builds up an electric charge.

"If the charge builds up enough it can suddenly flow as a huge current of electricity - either between the cloud and the ground, or between different clouds. We see this as a really big spark and it's what we call lightning."

When lightning flashes, it heats the air around it to about 10,000C - almost twice as hot as the surface of the Sun. The air gets hot so quickly that it expands with a bang, creating a huge vibration in the air. That vibration is what we hear as thunder.

You may think that thunder and lightning happen at the same time. But it does not. In fact, because light travels around a million times faster than sound, you will always see lightning before you hear thunder.

Golden Retriever Puppy Smiling

Why does thunder and lightning happen after a heatwave?

The experts explain that thunderstorms begin with warm air. This often happens after a long spell of hot weather, such as a heatwave, when the Sun has heated both the ground and the air above it.

As the warm air rises through the atmosphere, it cools and condenses into tiny water droplets. These droplets start moving in the cloud, and if the atmosphere is cold, they will start rising even further up into the atmosphere.

When the atmosphere is unstable, thunderstorm clouds, known as cumulonimbus clouds, develop. Cumulonimbus clouds are the only type of cloud capable of producing thunder, lightning and hail.

The Met Office issued many weather warnings this week for extreme heat

Met Office thunderstorm tips

The Met Office has forecast thunderstorms across parts of the UK, bringing thunder, lightning and heavy rainfall. In response, experts are urging people to take precautionary measures to protect both themselves and their property from potential damage and disruption.

It advises:

The Met Office warns: "Don't go outside to repair any damage during the storm."

For more tips on how to stay safe during a thunderstorm, visit the Met Office website.