We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在作者解释 divmod函数时提到 它的返回值,是一个元组(Tuple,至于这是什么东西,后面讲清楚),其中包括两个值,第一个是商,第二个是余 —— 此为该函数的输出。 而我根据英文文档 ,找不到Tuple返回值这样的关键字,我们新手又如何在这个英文文档中,知道它是返回 元组 呢?
divmod
Tuple
Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as (a // b, a % b). For floating point numbers the result is (q, a % b), where q is usually math.floor(a / b) but may be 1 less than that. In any case q * b + a % b is very close to a, if a % b is non-zero it has the same sign as b, and 0 <= abs(a % b) < abs(b).
The text was updated successfully, but these errors were encountered:
用python内建函数type,可以看到数据类型。
type(divmod(11,3))
Sorry, something went wrong.
No branches or pull requests
在作者解释
divmod
函数时提到它的返回值,是一个元组(Tuple,至于这是什么东西,后面讲清楚),其中包括两个值,第一个是商,第二个是余 —— 此为该函数的输出。
而我根据英文文档 ,找不到
Tuple
返回值这样的关键字,我们新手又如何在这个英文文档中,知道它是返回 元组 呢?The text was updated successfully, but these errors were encountered: