Example
Positional and Keyword Arguments
Difference between positional and keyword arguments. Flexible function calling.
Showing 1–10 of 12
Example
Difference between positional and keyword arguments. Flexible function calling.
Challenge
…find which parameter got which value, fix it with keyword arguments, then make calls that can't be swapped.
Example
Operator * allows accepting any number of positional arguments.
Quiz
…quiz on Python *args and **kwargs: 15 questions on extra arguments, tuples, dictionaries, and * and ** in calls. Instant answers.
Quiz
…quiz on Python functions: 15 questions on def, return, arguments, default values, *args, scope and docstrings. Instant answers.
Article Python Fundamentals
…hasn't heard of it yet. Passing data in: parameters and arguments A function that does exactly the same thing every time has its uses, but most of the time you want to hand it some information and let…
Example
Combining regular parameters, *args and **kwargs in one function.
Example
Functions enumerate() and range() extend for loop capabilities in Python.
Example
Tuples have only two methods: count() for counting and index() for searching.
Example
Searching, replacing and splitting text. Advanced string manipulation methods.