python2与python3的区别

在Windows系统中搭建Python编程环境python

#!/usr/bin/env python编程

此code表达在windows系统中pycharm使用条件!windows

ACISS码在不一样工具中使用的条件
手机,MP3支持各类版本GB2312,
可收录不一样文字用做编写程序
而电脑可支持GB18030
unicode表示为统一万国码,及各个国家的编码均可使用
它为每一个语言中的每一个字符设定了统一而且惟一的二进制编码,规定虽有的字符和符号最少由16位来表示(2个字节),即:2**16=65536
utf-8表示可变长的
app

utf-8用于Python2.0中将字符代码转换成中文,而在Python3.0不存在此状况,创做者已经将code进行了系统升级!工具

ACISS码转换的历史
 ASCII 255 1bytes
--> 1980 gb2312 7000多汉字
--> 1995 GBK.0 2w+
--> GB18030 27xxx
--> unicode 2bytes
--> utf-8  e:1byte, zh:3bytes
-->raw_input 2.x  = input 3.x
this


用户交互程序:
------info of %s ----
------info of ''' + character + ''' ----
------info of
{_name}----编码

 

# Author Eric fengspa

name = input("name:")code

#raw_input 2.x input  3.xorm

#input 2.x =

age = int(intput("age:"))#integer

print(type(age), type( str(age)))

job = input("job:")

salary = input("Salary:")

info = ""

-------info of %s -----

Name:%s

Age:%d

job:%s

Salary:%s

"%(name,name,age,job,salary)

info2 = ""

------info of {_name} -----

Name:{_name}

Age:{_age}

Job:{_salary}

'''.format(_name=name,

              _age=age,

              _job=job,

             _salary=salary)

 

info3 = ""

-------info of  {0}-----

Name:{0}

Age:{1}

Job:{2}

Salary:{3}

'''.format(name,age,job,salary)

print(info3)

这是三种不一样用户交互模式

区别:info of 后缀格式不一样,Y just use different code named "%s"But "%s"can not use into integer string,Y need change the %d to explore the number function,Sometimes plus "int" forhead of the age ,That will can be apply the program,

Second two:

Y just plus the {} this one to recongise different code.For instance {_name} and {int},So What is defferent ,You see. different line just like instead of the code,give the new meaning