Answer:
they generate heat, which is then used to make steam, which drives turbines that generate electricity.
Explanation:
First thing they do not directly produce electricity but yes they indirectly produce it. In some easy steps I'll explain you below.