The first law of thermodynamics states that energy cannot be created or destroyed. Plants do not create energy, but rather they harness it from the sun. They convert the light energy in the photons of sunlight into chemical energy in the bonds of carbohydrates they make. We get energy from consuming plants when we acquire and break down these chemical bonds in carbohydrates of plants for our cellular processes.
The first law of thermodynamics deals with the conservation of energy, stating that the total energy of a system remains constant. In other words, it is not possible to create or destroy energy, energy only changes from one state or another. Therefore, it is false to affirm that plants create energy. Plants use energy from sunlight during photosynthesis to convert carbon dioxide and water into glucose.
Flowers are attracted to the light because its wants makes them grow its kinda like humans eating food well as a flower they need water air and sunlight as there food.