문제

I have not understood why they write round(x[,n]) in syntax, but in codes they write round(10.6987,12) without square brackets before comma i.e, round(10.6987[,12])

도움이 되었습니까?

해결책

The square brackets aren't intended to by typed into your code. They just indicate that n is an optional parameter.

This style is recommended in the Documenting Python guide:

function

Describes a module-level function. The signature should include the parameters, enclosing optional parameters in brackets. Default values can be given if it enhances clarity. For example:

다른 팁

Square brackets are just a convention used to indicate optional arguments.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top