码迷,mamicode.com
首页 > 编程语言 > 详细

Python笔记

时间:2018-02-18 12:36:40      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:影响   nbsp   负数   类型   err   decode   inpu   三元运算   必须   

 

conda list  表示已经装好的库

conda install  ***

已经装好的再安装,不会受影响


#也可以不指定参数 ,必须要有顺序
# output3 = ‘‘‘
# --------output--------
# Name:{0}
# Age:{1}
# Love:{2}
# ‘‘‘ .format (name,
# age,
# love)
# print(output3)


#输入密文
import getpass

name = input("name:")
word = getpass.getpass("word:") #pycham会卡,需要到原方式去测试

print(name,word)
if: else: 会自动进行缩进
# indentationerror: 缩进错误

pyc 几乎是半成品的编译


数据类型
Python自动扩展int型--》long

三元运算
result = 值1 if 条件 else 值2


bytes
string --encode->bytes
bytes --decode->string

copy
deepcopy
联合账户


切片: 顾头不顾尾
有点类似数组 [ 头:尾 ]
负数也可以,意思是从尾部数

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   

Python笔记

标签:影响   nbsp   负数   类型   err   decode   inpu   三元运算   必须   

原文地址:https://www.cnblogs.com/qianyuesheng/p/8441095.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!