maximum.py分析
来源:互联网 发布:coredraw相关软件 编辑:程序博客网 时间:2024/05/21 14:46
def maximumValue( x, y, z ):
maximum = x
if y > maximum:
maximum = y
if z > maximum:
maximum = z
return maximum
#先定义一个函数,此函数用来求三个参数中的,最大的一个,并返回最大值
a = int( raw_input( "Enter first integer: " ) )
b = int( raw_input( "Enter second integer: " ) )
c = int( raw_input( "Enter third integer: " ) )
#获取三个整数
# function call
print "Maximum integer is:", maximumValue( a, b, c )
#打印最大的整数
print # print new line
d = float( raw_input( "Enter first float: " ) )
e = float( raw_input( "Enter second float: " ) )
f = float( raw_input( "Enter third float: " ) )
#获取三个浮点数
print "Maximum float is: ", maximumValue( d, e, f )
#打印最大的浮点数
g = raw_input( "Enter first string: " )
h = raw_input( "Enter second string: " )
i = raw_input( "Enter third string: " )
#获取三个字符串
print "Maximum string is: ", maximumValue( g, h, i )
#打印最大的字符串,此处用到了python的多态特性
- maximum.py分析
- urllister.py源码分析
- fibonacci.py源代码分析
- builddialectexamples.py源代码分析
- plural.py源代码分析
- regression.py源代码分析
- apihelpertest.py源代码分析
- argecho.py源代码分析
- soundex.py源代码分析
- plural1.py源代码分析
- toolbox.py源代码分析
- sum.py源代码分析
- stringFormatting.py源代码分析
- operator.py源代码分析
- average.py源代码分析
- square.py源代码分析
- classAverage.py源代码分析
- examResult.py源代码分析
- html5是否会终结silverlight,flash,javaflex
- 应用器 & 操纵器
- windows mobile下比较win32和MFC的效率
- 2007年11月27日
- Flex与JS(Javascript)相互调用
- maximum.py分析
- 2007年11月29日 (28没写)
- oracle set autotrace
- 标准数组——向量(1)
- 一年没用过Macromedia的三剑客(Dreamweaver,Flash,Fireworks)了
- 实现录制窗口成各种格式的图片和视频格式
- 如何去除SDI程序中Commandbar上的"新建"按钮
- Cache:一个隐藏并保管数据的场所
- Git Installation Document