Seedha content par jao
๐Ÿค– Python Hindi Bot
Namaste! Main Python Hindi Bot hoon ๐Ÿ
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
⇧
Python Hindi Logo
Python in Hindi | Programming Education
Python programming tutorial in Hindi banner Python code learning illustration Hindi Python student coding illustration Python data code pattern background

Python Tutorial in HindiiLearn Python Programming for Free

Learn Python from Beginner to Advanced in simple Hindi.

print("Namaste Python!")
# Variable banana
naam = "Ankit"
umar = 25
 
for i in range(3):
  print("Sikho!")
 
# Output:
Sikho! Sikho! Sikho!

Why Students Learn Here

๐Ÿ“š

Structured Tutorials

Beginner se Advanced tak step-by-step organized lessons.

๐Ÿ’ป

Practical Code

Real examples aur hands-on code jo actually samajh aaye.

๐Ÿง 

Python + AI Path

Ek clear roadmap jo Python se AI tak le jaata hai.

๐Ÿš€

Projects & Career

Portfolio-ready projects aur interview preparation.

Ye Kaise Kaam Karta Hai

Hindi mein Python, AI aur Data Skills seekhne ka sabse simple tareeka.

๐Ÿ“˜

Seekhein

Beginner se Advanced tak, best curated tutorials aur guides Hindi mein.

๐Ÿ’ป

Practice Karein

Real code examples aur mini-projects ke through hands-on practice karein.

๐Ÿ’ฌ

Judein

WhatsApp community se judkar apne doubts clear karein, akele nahi seekhenge.

Python to AI Learning Roadmap

Step-by-step learning path from Python basics to AI, Data Science and career-ready projects.

1
๐Ÿ

Python Basics

Introduction, Variables, Data Types, Operators, Input & Output, Conditions, Loops, Functions

Start Python →
2
๐Ÿ’ป

Python Intermediate

Lists, Tuples, Sets, Dictionaries, Strings, Functions, Modules, File Handling, Exception Handling

Continue Python →
3
⚙️

Advanced Python

OOP, Iterators, Generators, Decorators, Regular Expressions, APIs, Automation, Virtual Environments

Learn Advanced Python →
4
๐Ÿ—„️

SQL & Databases

SQL Basics, MySQL, SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY, Database Projects

Learn SQL →
5
๐Ÿ“Š

Data Analytics

NumPy, Pandas, Data Cleaning, Data Visualization, Matplotlib, Exploratory Data Analysis

Learn Data Analytics →
6
๐Ÿค–

Machine Learning

ML Basics, Supervised & Unsupervised Learning, Regression, Classification, Model Evaluation, Scikit-learn

Learn Machine Learning →
7
๐Ÿง 

Artificial Intelligence

AI Fundamentals, Generative AI, AI Tools, Prompt Engineering, LLM Concepts, AI Automation

Explore AI →
8
๐Ÿš€

Projects & Career

Python Projects, AI Projects, Data Projects, Portfolio, GitHub, Interview Preparation, Career Roadmap

Build Your Career →

Python args and kwargs in Hindi ๐Ÿ”ฅ | Functions เคฎें Arguments เค•ैเคธे Pass เค•เคฐें?

Python args เค”เคฐ kwargs - Functions เคฎें Arguments Pass เค•เคฐเคจे เค•ा Complete Guide

Python เคฎें *args เค”เคฐ **kwargs เคฆो เคธเคฌเคธे powerful เค”เคฐ useful features เคนैं เคœो เค†เคชเค•ो flexible functions เคฌเคจाเคจे เคฎें เคฎเคฆเคฆ เค•เคฐเคคे เคนैं। เค…เค—เคฐ เค†เคช Python เคธीเค– เคฐเคนे เคนैं เคคो เคฏเคน concepts เคฌเคนुเคค เคœเคฐूเคฐी เคนैं, เค–ाเคธเค•เคฐ เคœเคฌ เค†เคช real-world projects, libraries เคฏा frameworks เค•ा code เคชเคข़เคคे เคนैं। เค‡เคธ tutorial เคฎें เคนเคฎ เค‡เคจ เคฆोเคจों เค•ो step-by-step, เคขेเคฐ เคธाเคฐे real examples เค•े เคธाเคฅ เคธเคฎเคेंเค—े — เคฌिเคฒ्เค•ुเคฒ เคถुเคฐुเค†เคค เคธे เคฒेเค•เคฐ advanced use cases เคคเค•।

args เค”เคฐ kwargs เค•्เคฏा เคนैं?

args เค•ा เคฎเคคเคฒเคฌ เคนै "Arguments" เค”เคฐ kwargs เค•ा เคฎเคคเคฒเคฌ เคนै "Keyword Arguments"। เคฏे เคฆोเคจों เค†เคชเค•ो เคเค• function เคฎें variable number of arguments pass เค•เคฐเคจे เค•ी เคธुเคตिเคงा เคฆेเคคे เคนैं — เคฏाเคจी เค†เคชเค•ो เคชเคนเคฒे เคธे fix เคจเคนीं เค•เคฐเคจा เคชเคก़เคคा เค•ि function เค•ो เค•िเคคเคจे arguments เคฎिเคฒेंเค—े। เคฏเคน เค–ाเคธเค•เคฐ เคคเคฌ เค•ाเคฎ เค†เคคा เคนै เคœเคฌ เค†เคช เคเคธा function เคฌเคจा เคฐเคนे เคนों เคœो เค…เคฒเค—-เค…เคฒเค— situations เคฎें เค…เคฒเค—-เค…เคฒเค— number of inputs handle เค•เคฐे।

  • *args - Non-keyword (positional) arguments เค•ो tuple เค•े เคฐूเคช เคฎें pass เค•เคฐเคคा เคนै
  • **kwargs - Keyword arguments เค•ो dictionary เค•े เคฐूเคช เคฎें pass เค•เคฐเคคा เคนै

Normal function เคฎें parameters เค•ी เคธंเค–्เคฏा fix เคนोเคคी เคนै — เค…เค—เคฐ เค†เคชเคจे 2 parameters define เค•िเค, เคคो call เค•เคฐเคคे เคธเคฎเคฏ exactly 2 arguments เคนी เคฆेเคจे เคนोंเค—े, เคตเคฐเคจा Python error เคฆेเค—ा। เคฏเคนी limitation *args เค”เคฐ **kwargs เคธे เคฆूเคฐ เคนो เคœाเคคी เคนै।

Normal Function เค•ी Limitation เคชเคนเคฒे เคธเคฎเคें

def add_two(a, b):
    return a + b

print(add_two(5, 10))       # เค ीเค• เคšเคฒेเค—ा — Output: 15
print(add_two(5, 10, 15))   # Error! TypeError: add_two() takes 2 positional arguments but 3 were given

เคฏเคนाँ problem clear เคนै — function เคธिเคฐ्เคซ 2 values เค•े เคฒिเค design เคนुเค† เคนै। เค…เค—เคฐ เคนเคฎें 2, 5 เคฏा 100 numbers เคœोเคก़เคจे เคนों, เคคो เคนเคฎें เคเค• flexible เคคเคฐीเค•ा เคšाเคนिเค। เคฏเคนीं เคธे *args เค•ाเคฎ เค†เคคा เคนै।

*args เค•ो เคธเคฎเคเคคे เคนैं

*args เค•ा use เคคเคฌ เค•เคฐเคคे เคนैं เคœเคฌ เค†เคชเค•ो เคชเคนเคฒे เคธे เคชเคคा เคจเคนीं เคนोเคคा เค•ि function เค•ो เค•िเคคเคจे arguments เคฎिเคฒेंเค—े। Python เค‡เคจ เคธเคญी arguments เค•ो เคเค• tuple เคฎें convert เค•เคฐ เคฆेเคคा เคนै, เคœिเคธे เค†เคช loop เค•เคฐเค•े เค†เคธाเคจी เคธे access เค•เคฐ เคธเค•เคคे เคนैं।

*args เค•ा Basic Example:

def print_args(*args):
    print("Arguments type:", type(args))
    print("Arguments:", args)
    
    for arg in args:
        print(f"Argument: {arg}")

# Function เค•ो call เค•เคฐเคคे เคนैं
print_args(10, 20, 30, "Python")
print_args("Hello", "World")

Output:

Arguments type: <class 'tuple'>
Arguments: (10, 20, 30, 'Python')
Argument: 10
Argument: 20
Argument: 30
Argument: Python

Arguments type: <class 'tuple'>
Arguments: ('Hello', 'World')
Argument: Hello
Argument: World

*args เค•े เคธाเคฅ Sum เค•ा Example:

def add_numbers(*args):
    total = 0
    for num in args:
        total += num
    return total

# เค…เคฒเค—-เค…เคฒเค— arguments เค•े เคธाเคฅ call เค•เคฐเคคे เคนैं
print(add_numbers(5, 10))              # Output: 15
print(add_numbers(1, 2, 3, 4, 5))      # Output: 15
print(add_numbers(100, 200, 300))      # Output: 600
print(add_numbers())                   # Output: 0 (empty tuple)

เคฏเคน example เคฌเคคाเคคा เคนै เค•ि *args เค•े เค…ंเคฆเคฐ เคนเคฎ เคเค• normal loop เคšเคฒाเค•เคฐ เคนเคฐ value เค•ो เค†เคธाเคจी เคธे access เค•เคฐ เคธเค•เคคे เคนैं, เคšाเคนे arguments เค•ी เคธंเค–्เคฏा เค•ुเค› เคญी เคนो — เคฏเคนाँ เคคเค• เค•ि zero arguments เคญी valid เคนै।

*args เค•ा เคเค• เค”เคฐ Real Example — Maximum Number เคจिเค•ाเคฒเคจा:

def find_max(*args):
    if not args:
        return None
    biggest = args[0]
    for num in args[1:]:
        if num > biggest:
            biggest = num
    return biggest

print(find_max(4, 9, 2, 7))      # Output: 9
print(find_max(15, 3, 100, 22))  # Output: 100

**kwargs เค•ो เคธเคฎเคเคคे เคนैं

**kwargs keyword arguments เค•ो handle เค•เคฐเคคा เคนै। เค‡เคธเค•ा use เคคเคฌ เค•เคฐเคคे เคนैं เคœเคฌ เค†เคช named arguments pass เค•เคฐเคจा เคšाเคนเคคे เคนैं। เคฏे เคธเคญी keyword arguments เค•ो เคเค• dictionary เคฎें convert เค•เคฐ เคฆेเคคा เคนै, เคœिเคธเคฎें key argument เค•ा เคจाเคฎ เคนोเคคा เคนै เค”เคฐ value เค‰เคธเค•ी value।

**kwargs เค•ा Basic Example:

def print_kwargs(**kwargs):
    print("Kwargs type:", type(kwargs))
    print("Kwargs:", kwargs)
    
    for key, value in kwargs.items():
        print(f"{key}: {value}")

# Function เค•ो call เค•เคฐเคคे เคนैं
print_kwargs(name="Raj", age=25, city="Delhi")
print_kwargs(subject="Python", level="Beginner", duration="2 months")

Output:

Kwargs type: <class 'dict'>
Kwargs: {'name': 'Raj', 'age': 25, 'city': 'Delhi'}
name: Raj
age: 25
city: Delhi

Kwargs type: <class 'dict'>
Kwargs: {'subject': 'Python', 'level': 'Beginner', 'duration': '2 months'}
subject: Python
level: Beginner
duration: 2 months

**kwargs เค•ा Practical Example — Student Profile:

def student_profile(**kwargs):
    for key, value in kwargs.items():
        print(f"{key.capitalize()}: {value}")
    print("-" * 30)

student_profile(name="Ankit", course="Python", city="Lucknow")
student_profile(name="Priya", course="Data Analyst", marks=92)

เคฏเคนाँ เคนเคฐ เคฌाเคฐ function เค•ो เค…เคฒเค—-เค…เคฒเค— keys เค•े เคธाเคฅ call เค•िเคฏा เคœा เคธเค•เคคा เคนै, เคฌिเคจा function เค•ी definition เคฌเคฆเคฒे — เคฏเคนी **kwargs เค•ी เค…เคธเคฒी เคคाเค•เคค เคนै। เค…เค—เคฐ เค†เคช normal parameters เคธे เคฏเคนी เคšीเคœ़ เค•เคฐเคจा เคšाเคนें, เคคो เคนเคฐ student เค•े เคฒिเค เค…เคฒเค—-เค…เคฒเค— number of parameters เค•ी เคœเคฐूเคฐเคค เคชเคก़ेเค—ी, เคœो possible เคจเคนीं เคนै।

**kwargs เคธे Default Values Handle เค•เคฐเคจा (get method):

def create_user(**kwargs):
    username = kwargs.get("username", "Guest")
    role = kwargs.get("role", "User")
    print(f"Username: {username}, Role: {role}")

create_user(username="ankit123", role="Admin")
create_user(username="raj99")   # role เคจเคนीं เคฆिเคฏा, default "User" use เคนोเค—ा
create_user()                   # เคฆोเคจों default values use เคนोंเค—ी

Output:

Username: ankit123, Role: Admin
Username: raj99, Role: User
Username: Guest, Role: User

*args เค”เคฐ **kwargs เค•ो เคเค• เคธाเคฅ Use เค•เคฐเคจा

Real projects เคฎें เค…เค•्เคธเคฐ เคฆोเคจों เค•ो เคธाเคฅ use เค•िเคฏा เคœाเคคा เคนै। Python เคฎें rule เคฏเคน เคนै เค•ि เคชเคนเคฒे *args เค†เคคा เคนै, เคซिเคฐ **kwargs।

def create_employee(*args, **kwargs):
    print("Positional Arguments:", args)
    print("Keyword Arguments:", kwargs)

create_employee("Ankit", "Maurya", role="Developer", experience=3)

Output:

Positional Arguments: ('Ankit', 'Maurya')
Keyword Arguments: {'role': 'Developer', 'experience': 3}

Normal Parameters เค•े เคธाเคฅ Order:

เค…เค—เคฐ เค†เคช normal parameters, *args เค”เคฐ **kwargs เคคीเคจों เคธाเคฅ use เค•เคฐ เคฐเคนे เคนैं, เคคो order fix เคนोเคคा เคนै:

def full_example(a, b, *args, **kwargs):
    print("a:", a)
    print("b:", b)
    print("args:", args)
    print("kwargs:", kwargs)

full_example(1, 2, 3, 4, 5, city="Lucknow", country="India")

Output:

a: 1
b: 2
args: (3, 4, 5)
kwargs: {'city': 'Lucknow', 'country': 'India'}

Order เคนเคฎेเคถा เคฏเคนी เคฐเคนเคคा เคนै: normal parameters → *args → **kwargs। เค…เค—เคฐ เค†เคช order เคฌเคฆเคฒेंเค—े — เคœैเคธे **kwargs เค•ो *args เคธे เคชเคนเคฒे เคฒिเค–ेंเค—े — เคคो Python SyntaxError เคฆेเค—ा।

Function Call เค•เคฐเคคे เคธเคฎเคฏ *args เค”เคฐ **kwargs (Unpacking)

*args เค”เคฐ **kwargs เคธिเคฐ्เคซ function define เค•เคฐเคคे เคธเคฎเคฏ เคนी เคจเคนीं, เคฌเคฒ्เค•ि function call เค•เคฐเคคे เคธเคฎเคฏ เคญी use เคนोเคคे เคนैं — เค‡เคธे unpacking เค•เคนเคคे เคนैं। เค‡เคธเค•ा เคซाเคฏเคฆा เคคเคฌ เคฎिเคฒเคคा เคนै เคœเคฌ เค†เคชเค•ा data เคชเคนเคฒे เคธे เคเค• list, tuple เคฏा dictionary เคฎें เคฎौเคœूเคฆ เคนो।

def add(a, b, c):
    return a + b + c

numbers = [10, 20, 30]
print(add(*numbers))     # List เค•ो unpack เค•เคฐเค•े pass เค•िเคฏा — Output: 60

data = {"a": 1, "b": 2, "c": 3}
print(add(**data))       # Dictionary เค•ो unpack เค•เคฐเค•े pass เค•िเคฏा — Output: 6

เคฏเคน pattern เค–ाเคธเคคौเคฐ เคชเคฐ เคคเคฌ เคฌเคนुเคค useful เคนोเคคा เคนै เคœเคฌ เค†เคชเค•ा data เคชเคนเคฒे เคธे เค•िเคธी list เคฏा string เคธे process เคนोเค•เคฐ เค† เคฐเคนा เคนो เค”เคฐ เค‰เคธे เคธीเคงे function เคฎें pass เค•เคฐเคจा เคนो — เคฌिเคจा เคนเคฐ value manually เคฒिเค–े।

*args, **kwargs เค”เคฐ Class Inheritance (super())

เคเค• เคฌเคนुเคค common real-world use case เคนै — เคœเคฌ เคนเคฎ เค•िเคธी parent class เค•ो inherit เค•เคฐเคคे เคนैं เค”เคฐ เค‰เคธเค•े __init__ method เค•ो เค…เคฒเค—-เค…เคฒเค— เคคเคฐเคน เค•े arguments pass เค•เคฐเคจे เคนोเคคे เคนैं, เคคो *args, **kwargs เคฌเคนुเคค เค•ाเคฎ เค†เคคे เคนैं।

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

class Employee(Person):
    def __init__(self, *args, salary, **kwargs):
        super().__init__(*args, **kwargs)
        self.salary = salary

emp = Employee("Ankit", 28, salary=45000)
print(emp.name, emp.age, emp.salary)

Output:

Ankit 28 45000

เคฏเคนाँ Employee class เค•ो เคฏเคน เคœाเคจเคจे เค•ी เคœเคฐूเคฐเคค เคจเคนीं เค•ि Person class เค•ो exactly เค•िเคคเคจे เคฏा เค•ौเคจ-เคธे arguments เคšाเคนिเค — *args, **kwargs เค‰เคจ्เคนें automatically เค†เค—े pass เค•เคฐ เคฆेเคคे เคนैं।

*args, **kwargs เค”เคฐ Decorators

Decorators เคฎें เคญी เคฏเคน concept เคฌเคนुเคค เคœเคฐूเคฐी เคนै, เค•्เคฏोंเค•ि decorator เค•ो เคจเคนीं เคชเคคा เคนोเคคा เค•ि เคœिเคธ function เค•ो เคตो wrap เค•เคฐ เคฐเคนा เคนै, เค‰เคธเค•े parameters เค•्เคฏा เคนैं।

def my_decorator(func):
    def wrapper(*args, **kwargs):
        print("Function เคถुเคฐू เคนो เคฐเคนा เคนै...")
        result = func(*args, **kwargs)
        print("Function เค–เคค्เคฎ เคนुเค†।")
        return result
    return wrapper

@my_decorator
def greet(name, greeting="Namaste"):
    print(f"{greeting}, {name}!")

greet("Ankit")
greet("Priya", greeting="Hello")

Output:

Function เคถुเคฐू เคนो เคฐเคนा เคนै...
Namaste, Ankit!
Function เค–เคค्เคฎ เคนुเค†।
Function เคถुเคฐू เคนो เคฐเคนा เคนै...
Hello, Priya!
Function เค–เคค्เคฎ เคนुเค†।

เค‡เคธी เคตเคœเคน เคธे เคฒเค—เคญเค— เคนเคฐ generic decorator เคฎें เค†เคชเค•ो *args, **kwargs เคœเคฐूเคฐ เคฆिเค–ेเค—ा — เคฏเคน decorator เค•ो เค•िเคธी เคญी เคคเคฐเคน เค•े function เค•े เคธाเคฅ เค•ाเคฎ เค•เคฐเคจे เคฒाเคฏเค• เคฌเคจा เคฆेเคคा เคนै।

*args เค”เคฐ **kwargs — Common Mistakes

  • Wrong order: **kwargs เค•ो *args เคธे เคชเคนเคฒे เคฒिเค–เคจा — เคฏเคน เคนเคฎेเคถा SyntaxError เคฆेเค—ा।
  • Naming confusion: เค…เคธเคฒ เคฎें เคœเคฐूเคฐी เคธिเคฐ्เคซ * เค”เคฐ ** symbols เคนैं, เคจाเคฎ เค•ुเค› เคญी เคนो เคธเค•เคคा เคนै (เคœैเคธे *values, **info) — เคชเคฐ convention เค•े เคนिเคธाเคฌ เคธे args / kwargs เคนी use เค•เคฐें เคคाเค•ि code เคฌाเค•िเคฏों เค•ो เคญी readable เคฒเค—े।
  • Keyword argument เคฆो เคฌाเคฐ เคฆेเคจा: เคœैเคธे create_employee(name="Ankit", name="Raj") — เคฏเคน TypeError เคฆेเค—ा।
  • Positional argument keyword เค•े เคฌाเคฆ เคฆेเคจा: เคœैเคธे func(a=1, 2) — เคฏเคน เคญी SyntaxError เคนै, keyword arguments เคนเคฎेเคถा positional arguments เค•े เคฌाเคฆ เคนी เค†เคคे เคนैं।
  • *args เคฎें index เคธे over-access เค•เคฐเคจा: เค…เค—เคฐ args เคฎें เคธिเคฐ्เคซ 2 values เคนैं เค”เคฐ เค†เคช args[5] access เค•เคฐेंเค—े, เคคो IndexError เค†เคเค—ा — เค‡เคธीเคฒिเค loop เคฏा length check เค•เคฐเคจा safe เคฐเคนเคคा เคนै।

*args เค”เคฐ **kwargs เค•เคฌ Use เค•เคฐें?

  • เคœเคฌ function เค•ो เค•िเคคเคจे arguments เคฎिเคฒेंเค—े, เคฏเคน เคชเคนเคฒे เคธे เคชเคคा เคจ เคนो
  • Wrapper functions เค”เคฐ decorators เคฌเคจाเคคे เคธเคฎเคฏ (เคนเคฐ เคคเคฐเคน เค•े arguments เค†เค—े pass เค•เคฐเคจे เค•े เคฒिเค)
  • เคœเคฌ เค†เคช เคเค• flexible API เคฏा utility function design เค•เคฐ เคฐเคนे เคนों
  • Class เค•े __init__ method เคฎें เคœเคฌ parent class เค•ो dynamic arguments pass เค•เคฐเคจे เคนों
  • เคœเคฌ เค†เคช เค•िเคธी existing function เค•े เคŠเคชเคฐ เคเค• extra layer เคฌเคจा เคฐเคนे เคนों (เคœैเคธे logging, caching, validation)

Quick Summary Table

Feature *args **kwargs
Data Type Tuple Dictionary
Use Case Positional arguments Keyword (named) arguments
Symbol Single star (*) Double star (**)
Access Index / loop Key-value pair (.items())
Order in Function Normal params เค•े เคฌाเคฆ *args เค•े เคฌाเคฆ, เคธเคฌเคธे last เคฎें
Unpacking Symbol (call time) * (list/tuple) ** (dictionary)

FAQ - Python args เค”เคฐ kwargs เคธे เคœुเคก़े เคธเคตाเคฒ

1. args เค”เคฐ kwargs เค•ा เคจाเคฎ เค•्เคฏा fix เคนोเคคा เคนै?

เคจเคนीं। เคธिเคฐ्เคซ * เค”เคฐ ** symbols เคœเคฐूเคฐी เคนैं, เคจाเคฎ เค†เคช เค•ुเค› เคญी เคฐเค– เคธเค•เคคे เคนैं เคœैเคธे *values เคฏा **data। เคชเคฐ community convention เคฎें args เค”เคฐ kwargs เคนी เคธเคฌเคธे เคœ्เคฏाเคฆा use เคนोเคคे เคนैं เคคाเค•ि code readable เคฐเคนे।

2. เคเค• เคนी function เคฎें *args เค”เคฐ **kwargs เคฆोเคจों use เค•เคฐ เคธเค•เคคे เคนैं?

เคนाँ, เคฌिเคฒ्เค•ुเคฒ। เคฌเคธ order fix เคฐเคนेเค—ा — เคชเคนเคฒे normal parameters, เคซिเคฐ *args, เค”เคฐ เคธเคฌเคธे เค†เค–िเคฐ เคฎें **kwargs।

3. *args เค•ो call เค•เคฐเคคे เคธเคฎเคฏ list เค•्เคฏों use เค•เคฐเคคे เคนैं?

List เคฏा tuple เค•ो * เค•े เคธाเคฅ unpack เค•เคฐเคจे เคชเคฐ เค‰เคธเค•े เคนเคฐ element เค•ो เค…เคฒเค—-เค…เคฒเค— positional argument เค•ी เคคเคฐเคน เคญेเคœा เคœा เคธเค•เคคा เคนै, เคฌिเคจा manually เคนเคฐ value เคฒिเค–े।

4. **kwargs เคฎें duplicate keys เคฆे เคธเค•เคคे เคนैं เค•्เคฏा?

เคจเคนीं। เค…เค—เคฐ เค†เคช same keyword argument เคฆो เคฌाเคฐ เคฆोเค—े เคคो Python TypeError throw เค•เคฐेเค—ा, เค•्เคฏोंเค•ि dictionary เคฎें เคเค• key เคธिเคฐ्เคซ เคเค• เคฌाเคฐ valid เคนोเคคी เคนै।

5. *args เค”เคฐ **kwargs decorators เคฎें เค•्เคฏों เคœเคฐूเคฐी เคนैं?

Decorators เค•ो เคชเคคा เคจเคนीं เคนोเคคा เค•ि เคœिเคธ function เค•ो เคตो wrap เค•เคฐ เคฐเคนे เคนैं, เค‰เคธे เค•िเคคเคจे เค”เคฐ เค•िเคธ เคคเคฐเคน เค•े arguments เคฎिเคฒेंเค—े। เค‡เคธเคฒिเค *args, **kwargs use เค•เคฐเค•े เคธเคญी arguments เค†เค—े pass เค•เคฐ เคฆिเค เคœाเคคे เคนैं, เคšाเคนे original function เค•ा signature เค•ुเค› เคญी เคนो।

6. เค•्เคฏा *args เคนเคฎेเคถा tuple เคนी return เค•เคฐेเค—ा?

เคนाँ, function เค•े เค…ंเคฆเคฐ *args เคนเคฎेเคถा เคเค• tuple เค•ी เคคเคฐเคน behave เค•เคฐเคคा เคนै, เคšाเคนे เค†เคช เค•िเคคเคจे เคญी เคฏा เค•िเคธी เคญी data type เค•े arguments pass เค•เคฐें।

7. เค•्เคฏा เคนเคฎ *args เคฏा **kwargs เค•े เคฌिเคจा เคญी เค•ोเคˆ function flexible เคฌเคจा เคธเค•เคคे เคนैं?

Technically default parameters เคธे เคฅोเคก़ी flexibility เคฎिเคฒ เคธเค•เคคी เคนै, เคฒेเค•िเคจ truly unlimited/unknown number of arguments เค•ो handle เค•เคฐเคจे เค•ा เคธเคฌเคธे clean เค”เคฐ Pythonic เคคเคฐीเค•ा เคธिเคฐ्เคซ *args เค”เคฐ **kwargs เคนी เคนै।

8. super().__init__(*args, **kwargs) เค•्เคฏों use เค•เคฐเคคे เคนैं?

Inheritance เคฎें child class เค•ो parent class เค•े exact parameters เคฏाเคฆ เคฐเค–เคจे เค•ी เคœเคฐूเคฐเคค เคจเคนीं เคชเคก़เคคी। *args, **kwargs เคธाเคฐे received arguments เค•ो automatically parent เค•े __init__ เคคเค• pass เค•เคฐ เคฆेเคคे เคนैं, เคœिเคธเคธे code maintainable เคฐเคนเคคा เคนै।

Related Tutorials

๐Ÿง‘‍๐Ÿ’ป Python Coding Lab Python code likho, run karo aur practice karo — directly browser mein.