Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8683515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:03:58+00:00 2026-06-12T22:03:58+00:00

Are default argument values perceived as keyword arguments by Python? I’m not able understand

  • 0

Are default argument values perceived as keyword arguments by Python? I’m not able understand the distinction

I can’t understand this thread: Normal arguments vs. keyword arguments

On a side note, most tutorials and video series seemed to be geared towards Python 2.*. Should I learn Python 3 instead Python 2 or can I make the transition later easily? I’m just learning this out of curiosity.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:03:59+00:00Added an answer on June 12, 2026 at 10:03 pm

    Both concepts are (mostly) distinct.

    On function definition side, you have named parameters which have names, and you have variadic extensions, one for positional arguments (giving a tuple) and one for keyboard arguments (giving a dict).

    Example:

    def f(a, b=5, *c, **d): return a, b, c, d
    

    This function has two named parameters (aand b) which can be used positional or via keyword. c and d take all others given.

    You can call this function with positional arguments as well as with keyword arguments.

    f(1)
    f(a=1)
    

    both return

    1, 5, (), {}
    

    because positional and keyword arguments are assigned to the named parameters.

    You can as well do

    f(a=5, foo=12) or f(5, foo=12) # -> 5, 5, (), {'foo': 12}
    f(1, 2, 3) # -> 1, 2, (3,), {}
    

    In the last example, the positional arguments 1 and 2 are given to the named parameters a and b; the exceeding 3 is put into the tuple c.

    You cannot do

    f(b=90) # no value for a
    f(12, a=90) # two values for a
    

    If there are still unclearities, please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I programmatically access the default argument values of a method in Python?
Can I use default arguments in a constructor like this maybe Soldier(int entyID, int
In Python, what's the difference between arguments having default values: def f(a,b,c=1,d=2): pass and
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I'm finding that dictionary
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I'm trying to create
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I was working on
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument def f(a, L=[]): L.append(a)
Hopefully whoever reads this knows about default arguments: void setCase (string &str, int form
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I'm very confused about
Possible Duplicate: Least Astonishment in Python: The Mutable Default Argument The following code illustrates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.