Loading topic
print and len. This chapter shows how to write your own with def, what Python does when it reads a definition, and what happens when you call the function. It also6 min readdef, call built-in functions such as print and len, and work with lists, tuples and dictionaries. It covers the vocabulary of function inputs, what Python does when you call a function, and the errors you see when a call does not match5 min readprint and len, and how to write if statements. You should also be able to write a def statement with parameters. This chapter covers what a function hands back to its caller, and the mistakes that 5 min readdef, you know the difference between a parameter and an argument, and you have seen return. It covers how Python matches the arguments in a call to the parameters in a definition, and which mistakes come up most often.5 min readdef, and that you know positional and keyword arguments. A default value lets a caller leave an argument out. The function then uses a value you chose in advance.4 min readdef, use return to send one value back, and call functions with positional arguments. You should also know what a tuple is and that tuples are immutable sequences. Here you will see what Python does when a function returns several values, how c5 min readdef, pass it arguments, and use return. It covers which variables a function can see, which it creates, and why assigning to a name changes what that name means inside the function.5 min readdef, give parameters default values, and use lists and dictionaries. It also assumes you know that Python passes object references, so a function can change a list its caller owns. The chapter covers why one default value can leak state between cal5 min readdef, pass arguments by position and by keyword, and give parameters default values. You should also know tuples and dictionaries, because Python uses both to hold the extra arguments.4 min readdef, pass arguments by position and by keyword, and set default values. It also assumes you know what *args and **kwargs collect. Here you will use two markers in a parameter list, / and *, to decide which arguments callers must pass by po4 min readdef, pass arguments by position and keyword, and use return. You should also know that lists and dictionaries can be changed after they are created. Here you will learn the difference between a function that hands back a result and a function t6 min readdef, pass positional and keyword arguments, give parameters default values, and return a value or None. It also assumes you know the built-in types int, str, list, tuple and dict. Here you will add type hints to those functions and lea5 min readdef, use parameters and return, and read basic type hints. It covers what a docstring is, how Python stores it, how to structure one, and the mistakes that make docstrings misleading.5 min read