Test Your Knowledge Quiz

1. What is the output of the following code, and why?

>>> def func(a, b=4, c=5): ... print(a, b, c)

2. What is the output of this code, and why?

>>> def func(a, b, c=5): ... print(a, b, c)

3. How about this code: what is its output, and why?

>>> def func(a, *pargs): ... print(a, pargs)

4. What does this code print, and why?

>>> def func(a, **kargs): ... print(a, kargs)

5. One last time: what is the output of this code, and why?

>>> def func(a, b, c=3, d=4): print(a, b, c, d) >>> func(1, *(5,6))

6. Name three or more ways that functions can communicate results to a caller.

Was this article helpful?

0 0
Search Engine Manifesto

Search Engine Manifesto

Rank Your Web Pages HIGH in TOP Search Engine Popular Results For Maximum Exposure. Search Engines and How They Work Search Engines are special sites on the Web that are designed to help people find information stored on other sites.

Get My Free Ebook


Post a comment