What is Keyworded Variable Length Arguments | EP-45 Arbitrary Keyword Arguments | Python Tutorials

Subscribers:
28,000
Published on ● Video Link: https://www.youtube.com/watch?v=crgJ_Iv9Mxs



Duration: 0:00
47 views
0


Types of Python Function Arguments

"""Arbitrary arguments (variable-length arguments *args and **kwargs)
We use the “wildcard” or “*” notation like this – *args OR **kwargs – as our function’s argument when we have doubts about the number of arguments we should pass in a function.
Special Symbols Used for passing arguments in Python:

*args (Non-Keyword Arguments)
**kwargs (Keyword Arguments)
"""
What is Python *args?
"""Stands for "arguments.Allows you to pass an arbitrary number of positional arguments to a function.The arguments are collected into a tuple inside the function."""
def greet(*names):
for name in names:
print("Hello, " + name + "!")

greet("Alice", "Bob", "Charlie")

def class10(grade, *names):
print("Class10 :", grade)
for name in names:
print("name of students :", name)
print(type(names))

class10('Hello', 'Anju', 'Manju')


What is Python **kwargs?
"""Stands for "keyword arguments."
Allows you to pass an arbitrary number of keyword arguments to a function.The arguments
are collected into a dictionary inside the function."""
def print_info(**person):
print("Name:", person["name"])
print("Age:", person["age"])
print("City:", person["city"])
print(type(person))

print_info(name="Alice", age=30, city="New York")

Using both *args and **kwargs in Python to call a function
def my_function(*args, **kwargs):
print("Positional arguments:", args)
print("Keyword arguments:", kwargs)

my_function(1, 2, 3, x=4, y=5)

#PythonTutorial #PythonProgramming #FunctionArguments #ArbitraryKeywordArguments #LearnPython #Coding #FreePythonTutorials #PythonForBeginners #Programming #Python #Python3 #PythonTips #PythonDevelopment #Tutorial #Functions #Arguments #KeywordArguments #kwargs #args

Connect With Us:
—————————————
➡ ️ Websitehttps://www.cybrosys.com/m/
➡ ️ Email: info@cybrosys.com
➡ ️ Twihttps://twitter.com/cybrosysosys  
➡ ️ Lihttps://www.linkedin.com/company/cybrosys/brosys  
➡ ️ https://www.facebook.com/cybrosystechnologiesnologies  
➡ ️ https://www.instagram.com/cybrosystech/brosystech  
https://pinterest.com/cybrosys/  / cybrosys  




Other Videos By Cybrosys Technologies


2024-10-07How to Publish Job Position on Third-Party Job Board in Odoo 18 Recruitment | Odoo 18 New Features
2024-10-06Drag & Drop Attachments for Importing in Odoo 18 | Odoo 18 New Features | Odoo 18 Release Date
2024-10-06What is a Docstring in Python | EP-46 Docstring in Python | How to Use Docstrings in Python | Python
2024-10-06How to Request Documents/Files From Employees in Horilla HRMS | Best Open Source HRMS Software
2024-10-04Revamp in Odoo 18 Debug | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18 Debug Mode
2024-10-04What is Bi-Directional Replication (BDR) in Odoo | How BDR Can Revolutionize Your Odoo Deployments
2024-10-03How to Install Odoo 18 with Pycharm | Setup Odoo 18 Development Environment Using Pycharm in Ubuntu
2024-10-03How to Unblock Payment in Odoo 18 Accounting | Odoo 18 Accounting Tutorials | Odoo 18 New Features
2024-10-03Trend Lines in Odoo Chart in Odoo 18 | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18 Chart
2024-10-02How to Add New Employee in Horilla HRMS | Create New Employee in HRMS Software | Free HR Software
2024-10-01What is Keyworded Variable Length Arguments | EP-45 Arbitrary Keyword Arguments | Python Tutorials
2024-10-01How to Import Employee Data to Horilla HRMS | Free HRMS Software | Free Employee Management Software
2024-10-01What are the Types of Charts in Odoo 18 Spreadsheet | Odoo 18 Chart Type in Spreadsheet | Odoo 18
2024-09-30How to Manage Rotating Work Shifts in a Company Using Horilla HRMS | Implement Rotating Work Shifts
2024-09-30How to Configure Flexible Working Schedule in Odoo 18 Employee | Flexible Working Hours in Odoo 18
2024-09-28How to Manage Post Dated Cheque PDC in Odoo 17 Accounting | Post Dated Cheque Management in Odoo 17
2024-09-28Filters in Odoo 18 Spreadsheets | Odoo 18 Spreadsheets | Odoo 18 New Features | Odoo 18 Release Date
2024-09-27How to Manage Web Check In/Out & Time Runner in Horilla HRMS | Open Source HR Software | Free HRMS
2024-09-27How to Configure Reconciliation Models in Odoo 17 Accounting | Odoo 17 Accounting Tutorials| Odoo 17
2024-09-26How to Manage Validate, Approve & Validated Attendance in Horilla HRMS | Free HR Software| Free HRMS
2024-09-26Customer LOT/Serial Number Report in Odoo 18| Odoo 18 New Features | Odoo 18 Release| Odoo 18 Update