自动执行注释中的代码
示例代码
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 自动执行注释中的代码
def MyAbs(n):
# 注释 起点
'''
Function to get absolute value of number
like that
>>>MyAbs(1)
1
>>>MyAbs(0)
0
>>>MyAbs(-1)
1
'''
# 注释 终点
return n if (n >= 0) else (-n)
# 运行方法
def runTest():
MyAbs(-10)
# 运行
runTest()