Differences between revisions 8 and 9
Revision 8 as of 2018-10-11 14:48:27
Size: 2734
Comment:
Revision 9 as of 2018-10-11 15:16:18
Size: 2728
Comment:
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
 ||<|1> [[Python/Prog/Example/02/Ex_009a|Ex_02_009a_greatest_common_divisor_builtin.py]]||  ||<|1> [[Python/Prog/Example/02/Ex_009a/Contents|Ex_02_009a_greatest_common_divisor_builtin.py]]||
Line 56: Line 56:
 * [[attachment:Python/Prog/Example/02/Ex_02_009a_greatest_common_divisor_builtin.py|Ex_02_009a_greatest_common_divisor_builtin.py]]  * [[attachment:../Code/Ex_02_009a_greatest_common_divisor_builtin.py|Ex_02_009a_greatest_common_divisor_builtin.py]]

例題(9)


概要

[ edit ]

*


ポイント

[ edit ]

*


実行例

[ edit ]

  • 実行例(1) ... クリックすると拡大します

fig-01

*


本質的な部分 (授業中に順次公開します)

[ edit ]

import math

print( math.gcd( 350, 450 ) )
*


高度な話題 (授業中,もしくは授業後に順次公開します)

[ edit ]

  • この例題では,特に「高度な話題」はありません.


配布コード (授業中に順次公開します)

*

*

   1 import math
   2 
   3 print( math.gcd( 350, 450 ) )
  • 例題ファイルとしては,コメントを付け加えた,下記を配布します.
    • コメントはもう少し増えるかもしれません.

   1 #!/usr/bin/env python
   2 # -*- coding: utf-8 -*-
   3 # ==============================================================================
   4 # * Copyright (c) 2018 IIJIMA, Tadashi
   5 # *       (IIJIMA Laboratory, Dept. of Science and Technology, Keio University).
   6 # ==============================================================================
   7 # ソフトウェア工学[02] 例題[02]-(009a)  Ex_02_009a_greatest_common_divisor_builtin.py
   8 # Ex(Example) 02-009a: 【組込関数】 最大公約数 gcd ( greatest common divisor )の使い方. 
   9 #                               Python 3.3から導入された.
  10 #        2018-10-03 飯島 正 (iijima@ae.keio.ac.jp)
  11 # ==============================================================================
  12 # ----- 数学関数を扱うためのmathモジュールをインポートする -----
  13 import math
  14 # ==============================================================================
  15 # ===== 【メイン・プログラム】  =====
  16 print( math.gcd( 350, 450 ) )
  17 # ==============================================================================


SoftEng: Python/Prog/Example/02/Ex_009a (last edited 2018-10-28 12:38:24 by TadashiIijima)