Advertisement
sissou123

Untitled

Mar 24th, 2022
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. How to Use **kwargs in Python
  2. **kwargs allows us to pass a variable number of keyword arguments to a Python function. In the function, we use the double-asterisk (**) before the parameter name to denote this type of argument.
  3.  
  4. def total_fruits(**kwargs):
  5.     print(kwargs, type(kwargs))
  6.  
  7.  
  8. total_fruits(banana=5, mango=7, apple=8)
  9. for more:https://www.clictune.com/ez0F
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement