Shay Lempert
Shay Lempert

Reputation: 301

What does [,some_par] mean in python?

Looking through documentation I sometimes see a list of parameters containing par_n[,par x]. For example: str.center(width[, fillchar])

What does this mean? Any attempts of looking for answers using google and in stackoverflow have not been successful.

Upvotes: 0

Views: 51

Answers (1)

XlF42
XlF42

Reputation: 36

It marks an optional parameter. You can call mystring.center(42) as well as mystring.center(42, ' '). The function’s documentation should hint how the behavior would differ.

Upvotes: 2

Related Questions