Python学习笔记(2)——Functions
来源:互联网 发布:高德导航软件 编辑:程序博客网 时间:2024/06/18 08:28
第一次用CSDN感觉很新奇 写来自己玩(^▽^)
排版什么的就不太在意啦(捂脸)
5.
def one_good_turn(n): return n + 1def deserves_another(n): return one_good_turn(n) + 2
6.
def cube(number): return number**3def by_three(number): if number%3 == 0: return cube(number) else:
7. - 9.
import mathmath.sqrt(25)import math *from math import sqrt
中间都是只有一行 就略啦
16.
print type(42)print type(12.3)print type('str')
17.
def shut_down(s): if s == 'yes': return 'Shutting down' elif s == 'no': return 'Shutdown aborted' else: return 'Sorry'
18.
import mathprint math.sqrt(13689)
19.
def distance_from_zero(s): if type(s)== int or type(s)==float: return abs(s) else: return "Nope"
阅读全文
0 0
- Python学习笔记(2)——Functions
- Python学习笔记2——Python built-in functions学习
- Python学习——Functions
- UE4学习笔记: Functions
- UE4学习笔记: Functions
- swift学习笔记 -- Functions
- Python学习笔记(—):初识python
- LUA学习笔记1-Functions
- Swift3.0学习笔记-Functions
- Oracle 11g SQL学习笔记1——Using Aggregate Functions
- Java学习笔记(4)Mathematical Functions, Characters, and Strings
- Haskell语言学习笔记(13)Monadic Functions
- Think Python:Chapter 3: Functions 的笔记
- Python第四节FUNCTIONS学习汇总。
- Python学习教程-3_Use functions
- Python学习练习4----Functions(函数)
- 深度学习笔记——深度学习框架TensorFlow(九)[Building Input Functions with tf.contrib.learn]
- Python 学习笔记(2)——列表
- 【POJ 3414】Pots(BFS)
- Error: Couldn't find preset "env" relative to directory
- 字符串
- 数组的应用
- POJ 3468 A Simple Problem with Integers (树状数组) (区间修改+区间查询)
- Python学习笔记(2)——Functions
- 暑假第四天总结
- js 其他对象
- 二级指针做输入的3种模型-2
- MFC 单文档应用程序如何为状态栏添加进度条
- Linux -bash: java: command not found 解决方法
- HDU 2689 Sort it 树状数组
- 【PAT】【Advanced Level】1039. Course List for Student (25)
- 【算法基础】算法导论-最大子数组问题