A variable is an attribute of an object of study that may vary for different cases. Thus, a variable varies for different case studies in research. Considering the previous example of the survey on the temperature of many cities worldwide on the same day, the variables are "Temperature" and "City" because both the attributes vary for different cases.
Now variables can be of two types.
Numerical variable
They represent values that have numbers. For Example, age, weight, height.
Categorical variable
These variables represent values that have words, for example, name, nationality, sport, etc.