• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Python Puzzle 4

What is the output of

def foo(bar=None, **kwargs):
    print("\tbar={}".format(bar))
    print("\tkwargs={}".format(kwargs))


print("Test 1:")
foo(bar=12, holla=13)

print("Test 2:")
foo(holla=13, bar=12)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Output:

Test 1:
    bar=12
    kwargs={'holla': 13}
Test 2:
    bar=12
    kwargs={'holla': 13}

Published

Feb 25, 2019
by Martin Thoma

Category

Code

Tags

  • Programming 52
  • puzzle 22
  • Python 141

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor