Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Optional Arguments | Positional and Optional Arguments
Python Functions Tutorial
course content

Course Content

Python Functions Tutorial

Python Functions Tutorial

1. What is a Function in Python?
2. Positional and Optional Arguments
3. Arbitrary Arguments
4. Function Return Value Specification
5. Recursion and Lambda Functions

book
Challenge: Optional Arguments

Task
test

Swipe to show code editor

  1. Set the arguments name and greeting for the function.
  2. Set a default value for the greeting argument.
  3. Run the greet function by passing only the positional argument during execution, and leave the optional argument as its default.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 4
toggle bottom row

book
Challenge: Optional Arguments

Task
test

Swipe to show code editor

  1. Set the arguments name and greeting for the function.
  2. Set a default value for the greeting argument.
  3. Run the greet function by passing only the positional argument during execution, and leave the optional argument as its default.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt