Python_Multi_way decision
来源:互联网 发布:java多线程应用场景 编辑:程序博客网 时间:2024/06/10 07:45
From Vit: blog.csdn.net/svitter
#Multi_way decisionx = int(raw_input("Please input enter an integer:"))#input type is string, need to be translate.and get \n to;if x < 0: x = 0; print "Negative changed to Zero";elif x == 0: print "Zero";else: print "More";# Loops Lista = ['cat', 'windows', 'defense trate']for x in a: #check all of the array a print x, len(x)#Define and invode functiondef sum(a, b): return a + b;func = sumr = func(5, 6);print r;#Defines function with defalt argumentdef add(a,b=2): return a+br = add(1)print rr = add(1, 5)print r#a useful functionprint "a is: " + str(a)a = range(5, 10)print aa = range(-2, -7)print aa = range(-7, -2)print aa = range(-2,-11,-3) #The 3rd parameter stands for stepprint a
0 0
- Python_Multi_way decision
- Decision
- Decision
- decision
- Decision
- decision point
- decision tree
- decision tree
- decision tree
- Decision Tree
- Decision Trees
- Decision Trees
- Decision Trees
- Decision Tree
- Decision Tree
- Decision Tree
- Decision Tree
- Decision Tree
- Oracle宝典--编码规范
- 内省IntroSpector与JavaBean
- 使用socket模拟Http请求
- Windows上python开发--2安装django框架
- DLL注入代码(C函数)的编写
- Python_Multi_way decision
- poj2503 Babelfish
- poj 3764 The xor-longest Path
- 基于格子的AOI算法
- 【Leetcode】Merge Two Sorted Lists
- Codefoces 432C Prime Swaps(数论+贪心)
- 黑马程序员-Java基础09
- 微博阅读器demo(二) 微博列表
- 最优路径问题 mod 4 的最小值