- [Narrator] Just like some other programming languages,…Python functions support variable argument lists…and this makes it possible to build functions…that have a high degree of flexibility…by accepting different numbers of parameters.…A good example of this might be an addition function…that adds up the parameters passed to it.…Now it would be pretty inconvenient to require…cause of this function to have to conform…to putting all the numbers into a list.…So defining the function to accept a variable list…of parameters would be a better way to go.…To do this in Python,…you define the function argument…using an asterisk character in front of the parameter…that you want to make variable.…
This parameter has to come after all the other…positional parameters that the function defines.…For example, if we built a logging function…that logged messages along with parameter values,…we would maybe first define the parameters…for the message type and the message…and then specify the variable argument list.…So let's try this out in some actual code.…
- Truth value testing
- Template strings
- Advanced Python functions
- Advanced collections
- Advanced classes and objects
- Python comprehensions: list, dictionary, and set
Skill Level Advanced
1. Python Language Features
2. Built-In Functions
3. Advanced Python Functions
4. Advanced Collections
5. Advanced Classes and Objects
6. Using Logging
7. Python Comprehensions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.