Python 学习笔记二
来源:互联网 发布:安卓mac修改工具 编辑:程序博客网 时间:2024/06/05 10:06
多行字符串‘’‘...'''前面加r使用的作用是禁止字符串转义。
例子:
print("sadsad\\n")
sadsad\n
print(r"sadsad\\\n")
sadsad\\\n
----------------------------------------------------------------
Python3 基础:条件判断句
在代码的开头一定要标注运行环境和“代码编号”!
#!/usr/bin/env python#coding:utf-8age = input('Please write your age:')if age >= 18:print("adult")elif age <= 17:print("teenager")else:print("kind")在编写上述代码中遇到PEP 263问题,查看官档解决办法如下:
To define a source code encoding, a magic comment must be placed into the source files either as first or second line in the file, such as:
# coding=<encoding name>
or (using formats recognized by popular editors):
#!/usr/bin/python# -*- coding: <encoding name> -*-
or:
#!/usr/bin/python# vim: set fileencoding=<encoding name> :
0 0
- python学习笔记二
- Python学习笔记(二)
- python学习笔记二
- python学习笔记:二
- python 学习笔记二
- python学习笔记(二)
- Python学习笔记二
- python学习笔记二
- python学习笔记二
- python 学习笔记(二)
- python学习笔记二
- python学习笔记二
- python学习笔记二
- Python学习笔记(二)
- python学习笔记(二)
- Python学习笔记二
- Python学习笔记二
- python学习笔记二
- Elasticsearch Java Api(六)--DeleteByQuery
- Kafka设计解析(三)- Kafka High Availability (下)
- pat a1046(暂缺)
- 关于非c++11标准 vector容器的初始化
- PostgreSQL:Problem running post-install step. The database cluster initialisation failed. 解决方法。
- Python 学习笔记二
- jquery ajax pagination分页的使用实例(内含jquery.pagination.js)
- EditText的一些常用设置
- Android-Handle类总结
- 在CentOS 7.0 上安装Redis 3.0.3
- springmvc使用ssi-uploader批量上传图片及后台接受
- TCP/IP、Http、Socket的区别
- MVC模式心得
- Linux对mysql5.5.2进行自动安装