Yup. You’ll see functions wrapped inside other functions all the time. The function on the inside will run first, then the next, etc.
In the example I gave, the value of nam is a string. But it you need to perform some mathematical function to it, it needs to be interpreted as a number. So once the value is received, int() will convert it into a number. Finally, that final value will be assigned to nam. Wrapping functions inside of functions is a great way to write concise code.
As a data center engineer of 10+ years, I struggled to understand this at first. In my world, the hardware does a POST before the OS boots and has an inventory of what hardware components are available, so it shouldn’t matter in what order they are discovered, since the interface names should make a correlation between the interface and the pcie slot that NIC exists in.
Where the water gets muddled is in virtualized servers. The NICs no longer have a correlation to a specific hardware component, and you may need to configure different interfaces in the virtualized OS for different networks. I think in trying to create a methodology that is agnostic to bare metal/virtualized OSs, it was decided that the naming convention should be uniform.
Probably seems like bloat to the average admin who is unconcerned with whether these NICs are physical or virtual, they just want to configure their server.