Python Forum
omitting arguments in function/method calls
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
omitting arguments in function/method calls
#4
With the parameter's name:

def foo(bar, spam = 'spam', eggs = 'eggs'):
    print("I'll have {} with {} and {}.".format(bar, spam, eggs))
foo('pizza', eggs = 'huevos')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: omitting arguments in function/method calls - by ichabod801 - Nov-23-2019, 01:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  optimizing calls to isinstance() Skaperen 0 900 Nov-27-2022, 01:33 AM
Last Post: Skaperen
  extracting a function/class/method from code Skaperen 5 2,250 Mar-30-2022, 12:13 AM
Last Post: Skaperen
  function/method keyword argument alias Skaperen 1 3,122 Dec-01-2019, 03:56 AM
Last Post: Gribouillis
  how operators are implemented as function calls Skaperen 5 3,500 Dec-15-2018, 03:14 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020