Translations:Introduction to Python/181/en

Extremely simple: the def command defines a new function. You give it a name, and inside the parenthesis you define arguments that we'll use in our function. Arguments are data that will be passed to the function. For example, look at the len command. If you just write len alone, Python will tell you it needs an argument. That is, you want len of something, right? Then, for example, you'll write len(myList) and you'll get the length of myList. Well, myList is an argument that you pass to the len function. The len function is defined in such a way that it knows what to do with what is passed to it. Same as we did here.