はじめてのPython(9)
関数
#coding: UTF-8 #関数 def max(num1, num2): if num1 > num2 : ret = num1 else: ret = num2 return ret a = 10 b = 5 print max(a,b) #10
参考文献
Pythonを学ぼう 第24回 関数の基礎
http://www.isl.ne.jp/pcsp/python/python24.html
#coding: UTF-8 #関数 def max(num1, num2): if num1 > num2 : ret = num1 else: ret = num2 return ret a = 10 b = 5 print max(a,b) #10
Pythonを学ぼう 第24回 関数の基礎
http://www.isl.ne.jp/pcsp/python/python24.html