LoginSignup
1
2

More than 5 years have passed since last update.

【Python】商と余りを一度に求める

Last updated at Posted at 2019-01-05

商と余りを一度に求める

>>> x = 11
>>> y = 4
>>>
>>> divmod(x, y)
(2, 3)
>>>
>>> (x // y, x % y)
(2, 3)

※Python 3.7.1 で確認

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2