首页 > 编程语言 > 详细

简明Python docstrings

时间:2017-12-17 15:35:06      阅读:198      评论:0      收藏:0      [点我收藏+]
 1 #!/usr/bin/env python
 2 #coding:utf-8
 3 def print_max(x,y):
 4     ‘‘‘Prints the maximum of two numbers.打印两个数值中的最大数。
 5         The two values must be integers.这两个数都应该是整数‘‘‘
 6 #如果可能,将其转换至整数类型
 7 x=int(x)
 8 y=int(y)
 9 
10 if x>y:
11     print(x,is maxinum)
12 
13 else:
14     print(y,is maxinum)
15 
16 print_max(3, 5)
17 print(print_max.__doc__)
1 5 is maximum
2 Prints the maximum of two numbers.
3         The two values must be integers.

 

简明Python docstrings

原文:http://www.cnblogs.com/jdy113/p/8052055.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!