How can you specify a default value for a parameter in a function definition?

  • By wrapping the parameter in square brackets []
  • Using an asterisk (*)
  • Using the '=' sign
  • Using the 'default' keyword
To specify a default value for a parameter, you can use the '=' sign followed by the default value. For example, def func(param=10):.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *