摘要: print("python字典是一系列键值对")print("字典用花括号标识")person1={'name':'小明','age':16} print("访问字典值:")print("我是"+person1['name'])print("我今年"+str(person1['age'])+"岁了" 阅读全文
posted @ 2018-05-03 15:15 chuanzi 阅读(150) 评论(0) 推荐(0) 编辑
摘要: print("python数字包括整数(int/integer)和浮点数(float)两种类型")print("加(+)减(-)乘(*)除(/)")print("乘方(**)求模(%)整除(//);py2整除(/)")print("浮点数的不确定性:")print("0.2"+"+"+"0.1"+" 阅读全文
posted @ 2018-05-03 15:14 chuanzi 阅读(148) 评论(0) 推荐(0) 编辑
摘要: print("列表由一系列按特定顺序排列的元素组成。")print("python用方括号[]来表示列表")num_list=[1,2,2,2,2,3,4,5]str_list=["China","Guangdong","Guangzhuo"]print("length of str_list is 阅读全文
posted @ 2018-05-03 15:14 chuanzi 阅读(170) 评论(0) 推荐(0) 编辑
摘要: message="hello" print(message) message="hello world" print(message) print("使用"+"加号"+"拼接"+"字符串") str1="字符串可以使用双引号定义" str2='字符串也可以使用单引号定义' str3="也可以'混搭' 阅读全文
posted @ 2018-05-03 15:13 chuanzi 阅读(211) 评论(0) 推荐(0) 编辑