python-python-变量和变量
1 #Author:Archer Zon 2 #变量 3 name = "archerzon" 4 name2 = name 5 print("我的名字是",name,name2) 6 7 #变量命名规则 8 gf_of_archerzon = "Wang" 9 print("archerzon的女盆友是",gf_of_archerzon) 10 print("archerzon的女盆友是%s"%gf_of_archerzon) 11 12 13 #常量 14 PIE = 3.1415926#常量为大写字母 15 print("π=%s"%PIE)
小结:字符串不加双引号“”或单引号‘’,则是变量。
_username = 'archerzon' #archerzon为字符串 _password = archerzon #archerzon为变量

浙公网安备 33010602011771号