python实现类似switch功能
来源:互联网 发布:水波算法 编辑:程序博客网 时间:2024/06/05 06:21
下面是python实现了类似其他语言switch功能代码
#!/usr/bin/python#coding:utf-8from __future__ import divisiondef jia(x,y): return x+ydef jian(x,y): return x-ydef cheng(x,y): return x*ydef chu(x,y): return x/yoperator = {"+":jia,"-":jian,"*":cheng,"/":chu}def f(x,o,y): print operator.get(o)(x,y)f(3,"+",2)
0 0
- python实现类似switch功能
- python实现switch功能
- Python实现类似switch的分支结构
- python字典实现switch功能
- python dict 实现 switch 功能
- Python中实现switch功能
- [EXCEL]实现类似Switch case的函数功能
- Python利用字典实现switch功能
- Python利用字典实现switch功能
- python学习总结---switch功能实现
- python实现简单的switch功能
- python实现类似awk的简单功能
- 使用Python函数和字典实现Java中的switch功能
- python之 利用字典与函数实现switch case功能
- 实现 类似资源管理器功能
- python switch的实现
- python中实现switch
- Python的switch实现
- Tomcat Server配置
- UItableview x详解
- c++模板选择排序
- python模拟ctrl+v
- iOS开发-UITableView单选多选/复选实现1
- python实现类似switch功能
- Shared libraries with Eclipse CDT and cygwin on Windows
- struts 验证规则
- Snail—OC学习之空变量的表示
- Codeforces Round #282 (Div. 2) C. Treasure 贪心
- JS中Null与Undefined的区别
- mysql 输出表的详细信息详解 show table status like '表名'
- Code Forces 535 B. Tavas and SaDDas(数论)
- Android 启动过程分析--笔记缩减