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

  • Home
  • SEARCH
  • 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 105753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:29:20+00:00 2026-05-11T01:29:20+00:00

Does * have a special meaning in Python as it does in C? I

  • 0

Does * have a special meaning in Python as it does in C? I saw a function like this in the Python Cookbook:

def get(self, *a, **kw) 

Would you please explain it to me or point out where I can find an answer (Google interprets the * as wild card character and thus I cannot find a satisfactory answer).

  • 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. 2026-05-11T01:29:20+00:00Added an answer on May 11, 2026 at 1:29 am

    See Function Definitions in the Language Reference.

    If the form *identifier is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form **identifier is present, it is initialized to a new dictionary receiving any excess keyword arguments, defaulting to a new empty dictionary.

    Also, see Function Calls.

    Assuming that one knows what positional and keyword arguments are, here are some examples:

    Example 1:

    # Excess keyword argument (python 3) example: def foo(a, b, c, **args):     print("a = %s" % (a,))     print("b = %s" % (b,))     print("c = %s" % (c,))     print(args)      foo(a="testa", d="excess", c="testc", b="testb", k="another_excess") 

    As you can see in the above example, we only have parameters a, b, c in the signature of the foo function. Since d and k are not present, they are put into the args dictionary. The output of the program is:

    a = testa b = testb c = testc {'k': 'another_excess', 'd': 'excess'} 

    Example 2:

    # Excess positional argument (python 3) example: def foo(a, b, c, *args):     print("a = %s" % (a,))     print("b = %s" % (b,))     print("c = %s" % (c,))     print(args)          foo("testa", "testb", "testc", "excess", "another_excess") 

    Here, since we’re testing positional arguments, the excess ones have to be on the end, and *args packs them into a tuple, so the output of this program is:

    a = testa b = testb c = testc ('excess', 'another_excess') 

    You can also unpack a dictionary or a tuple into arguments of a function:

    def foo(a,b,c,**args):     print("a=%s" % (a,))     print("b=%s" % (b,))     print("c=%s" % (c,))     print("args=%s" % (args,))  argdict = dict(a="testa", b="testb", c="testc", excessarg="string") foo(**argdict) 

    Prints:

    a=testa b=testb c=testc args={'excessarg': 'string'} 

    And

    def foo(a,b,c,*args):     print("a=%s" % (a,))     print("b=%s" % (b,))     print("c=%s" % (c,))     print("args=%s" % (args,))  argtuple = ("testa","testb","testc","excess") foo(*argtuple) 

    Prints:

    a=testa b=testb c=testc args=('excess',) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You've probably seen the documentation here: http://msdn.microsoft.com/en-us/library/bb290881.aspx that describes the… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer It's the same as while (<STUFF>) { print "Line $.… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer AStream is declared as OUT parameter, which means it isn't… May 11, 2026 at 11:43 pm

Related Questions

Possible Duplicate: How does an underscore in front of a variable in a cocoa
In attempting to use scipy's quad method to integrate a gaussian (lets say there's
Namely, how does the following code: var sup = new Array(5); sup[0] = 'z3ero';
When I create a new VARCHAR column in Microsoft SQL Server Manager Studio, it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.