文档字符串 __doc__
来源:互联网 发布:矩阵lu分解例题3*3 编辑:程序博客网 时间:2024/06/11 11:12
def printMax(x, y):
'''Prints the maximum of two numbers.
The two values must be integers.'''
x = int(x) # convert to integers, if possible
y = int(y)
if x > y:
print x, 'is maximum'
else:
print y, 'is maximum'
'''Prints the maximum of two numbers.
The two values must be integers.'''
x = int(x) # convert to integers, if possible
y = int(y)
if x > y:
print x, 'is maximum'
else:
print y, 'is maximum'
printMax(3, 5)
输出为:5 is maximum
printMax(3, 5)
print printMax.__doc__
输出为:
5 is maximum
Prints the maximum of two numbers.
The two values must be integers
文档字符串的惯例是一个多行字符串,它的首行以大写字母开始,句号结尾。第二行是空行,从第三行开始是详细的描述。
阅读全文
0 0
- 文档字符串 __doc__
- python整理笔记3---__doc__(文档字符串)
- python 文档资源 dir __doc__
- Python对象的文档字符串(DocString):__doc__的写法和输出方法
- __doc__
- __doc__
- 在命令行中查看python帮助文档 --dir、help、__doc__
- python __doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
- 在命令行模式下查看Python帮助文档---dir、help、__doc__
- python __doc__
- python中的__doc__,__name__
- Python中的__doc__
- python __str__(),__dir__(),__doc__
- self、__doc__、__init__、__name__
- 文档字符串
- MySQL insert技巧
- Android上Java程序和Opengl通信方式和opengl es着色器
- rails链接js/css
- php排序的实现
- Loadrunner在Java Vuser当中常用的一些Web函数
- 文档字符串 __doc__
- HTTP_REFERER和HSTS
- How does a HashMap work in JAVA
- mybatis中resultMap使用之返回分组数据
- 个税案例算法
- 指定jre运行jar程序
- FPGA学习笔记:面向验证和仿真的行为描述语句(2)
- #ifdef __cplusplus extern "C" { #endif /* __cplusplus */
- reducer中处理数组数据的赋值