The weather is the condition of the atmosphere in one area at a particular time, for example if it is raining, hot of windy.

(In this sentence can we use ' whether' instead of 'if' after 'for example' to have the same meaning?)

Yes, in that sentence "whether" and "if" can be interchangeable.

No, in this sentence, "whether" cannot be used instead of "if" after "for example" to convey the same meaning.

The word "if" is used to introduce a conditional clause that expresses a condition or possibility. In this context, "if" is used to state that the weather conditions being mentioned (raining, hot, or windy) are examples of the types of conditions that can exist at a particular time.

On the other hand, "whether" is used to introduce a choice or possibility between two alternatives. It is used when there are two or more options or possibilities to consider. In the given sentence, there is no choice or alternative being presented. The intention is simply to provide examples of different weather conditions, not to present a choice between them.

So, using "whether" instead of "if" after "for example" would change the meaning of the sentence and might imply a choice between the mentioned weather conditions, which is not the intended meaning.