Function: A method of obtaining output based on some input. Defining a function is to define the method of processing input, just as defining a recipe is to define the cooking method of a dish; Function has input conditions, just like cooking needs raw materials; Functions have function bodies, just like the specific steps of cooking; The function does not return the result, just like there is always something cooked when cooking.
Variable: A place where something is kept. Define a variable, which can store the numerical value needed for calculation and update this value when necessary, just like a schoolbag can hold stationery books and can be used or replaced when necessary; Variables have living space, beyond which they cannot be read and updated, just as stationery cannot be used without schoolbags. Variables take up storage space, and if they are not needed, they will take up resources, just like a schoolbag with unused things will take up space.