python 条件定义函数
2013-02-23 23:22
295 查看
'''
Created on 2013-2-23
@author: Administrator
'''
sum = 1;
if(sum):
def add():
print 'add function';
else:
def sub():
print 'sub function';
add();
Created on 2013-2-23
@author: Administrator
'''
sum = 1;
if(sum):
def add():
print 'add function';
else:
def sub():
print 'sub function';
add();
相关文章推荐
- python 笔记 之 if条件选择 函数的定义 及 格式
- Python的列表等变量的声明必须要在函数定义与函数调用之前
- python 小技巧(函数定义)
- python 里map()函数想到的外国人为什么要这么定义函数
- python函数的参数定义和可变参数
- Python函数定义简单示例
- Python 字符串类型定义及常用函数
- Python定义函数,模块导入以及Python主程序文件结构
- python学习03--函数定义与调用
- python 函数定义
- python函数—定义参数的几种方式
- python中函数的定义意思
- 零基础学python-15.3 函数的定义、调用与多态
- python--基础学习(二)判断 、循环、定义函数、继承、调用
- Python定义函数,模块导入以及Python主程序文件结构
- python学习笔记 定义函数
- 5.4Python函数(4):函数参数的定义和调用总结
- Python中函数的参数定义和可变参数
- Python 函数的定义与调用
- python学习笔记--函数定义、调用与默认参数