Python
来源:互联网 发布:不安全网络怎么解决 编辑:程序博客网 时间:2024/05/16 03:40
//输入
name = input()//直接转义特殊字符串s3 = r'Hello, "Bart"'//输出
print(100 + 200)//输出带换行# print Stringprint('''abcd''')//输入带提示name = input('please enter your name: ')//if----else# print absolute value of an integer:# 关键字 or not and# 空值是Python里一个特殊的值,用
None
表示。None
不能理解为0
,因为0
是有意义的,而None
是一个特殊的空值。a = 100if a >= 0: print(a)else: print(-a)//编码转换ord('A') = 65
ord('中') =
20013
chr(66) = A//转成Bytes传输
x = b'ABC//字符串对照
%d整数%f浮点数%s字符串%x十六进制整数'Hi, %s, you have $%d.' % ('Michael', 1000000)'Hi, Michael, you have $1000000.'
//数组操作函数
http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014316724772904521142196b74a3f8abf93d8e97c6ee6000classmates.append('Adam')
classmates.insert(1, 'Jack')
classmates.pop()
//定义函数classmates.pop(1)
def
关键字//数组函数
reduce
= implodesum = sumfilter
= 筛选sorted
= 排序
//16进制
1.23x109 =1.23e9
0.000012 =1.2e-5
0 0
- Python
- Python
- Python
- python
- Python
- PYTHON
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- python
- Python
- map vector 插入时间复杂度
- 阿里云CentOS安装typecho
- Expression: _pFirstBlock==pHead
- 游戏中的网络同步机制——Lockstep
- Android之多线程 Handler 详解
- Python
- 去掉ExpandableListView的箭头图标
- Gson解析 解析包含有data字段的json数据
- 关联函数的位置
- 异常封装
- JSTL fmt 标签 应用及举例
- 表单验证
- iOS 构造json并提交到服务器
- 手把手教你逆向分析 Android 程序