English

What is the difference between default Parameters and positional parameters in Python? - Computer Science (Python)

Advertisements
Advertisements

Question

What is the difference between default Parameters and positional parameters in Python? 

Distinguish Between
Advertisements

Solution

  Default Parameters Positional Parameters
1. These are parameters that have a predefined value assigned in the function header. These are parameters that must be passed in the correct order during a function call.
2. If no value is provided by the caller, the function uses the default value. The caller must provide a value for every positional parameter; otherwise, an error occurs.
shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Set 4

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×