上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 55 下一页
摘要: result: example2: result : 阅读全文
posted @ 2019-06-24 17:50 嵌入式实操 阅读(188) 评论(0) 推荐(0) 编辑
摘要: while 语句: for 语句: 阅读全文
posted @ 2019-06-24 17:33 嵌入式实操 阅读(238) 评论(0) 推荐(0) 编辑
摘要: >>> age = 10 >>> assert 0 ", line 1, in AssertionError >>> assert 0 < age < 11 阅读全文
posted @ 2019-06-24 17:29 嵌入式实操 阅读(118) 评论(0) 推荐(0) 编辑
摘要: x == y x < y x <= y x >= y x != y x is y x is not y x in y x not in y 阅读全文
posted @ 2019-06-24 17:28 嵌入式实操 阅读(191) 评论(0) 推荐(0) 编辑
摘要: int(x [,base ]) 将x转换为一个整数 long(x [,base ]) 将x转换为一个长整数 float(x ) 将x转换到一个浮点数 complex(real [,imag ]) 创建一个复数 str(x ) 将对象 x 转换为字符串 repr(x ) 将对象 x 转换为表达式字符串 阅读全文
posted @ 2019-06-24 17:22 嵌入式实操 阅读(4208) 评论(0) 推荐(0) 编辑
摘要: name = input('what is your name?')if name.endswith('zd'): print("hello panzidong") name = input('what is your name?')if name.endswith('zd'): print("he 阅读全文
posted @ 2019-06-24 17:18 嵌入式实操 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 序列解包: >>> x,y,z = 1, 2, 3>>> print(x, y, z)1 2 3 >>> a,b, *reset = [1,2,3,4]>>> print(a,b,reset)1 2 [3, 4] 链式赋值: x = y = function 增量赋值: >>> x = 2>>> x 阅读全文
posted @ 2019-06-24 17:09 嵌入式实操 阅读(168) 评论(0) 推荐(0) 编辑
摘要: >>> print("aaaa","bbbb")aaaa bbbb>>> print(1, 2, 3)1 2 3 为模块提供别名: >>> import math as foobar>>> foobar.sqrt(4)2.0 为函数提供别名: >>> from math import sqrt as 阅读全文
posted @ 2019-06-24 17:03 嵌入式实操 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 字典的创建: >>> phonebook = { 'Alice': '2341', 'Beth': '9102', 'Cecil': '3258'} dict函数: >>> items = [('name','pan'),('age', 32)]>>> d = dict(items)>>> d{'n 阅读全文
posted @ 2019-06-24 16:55 嵌入式实操 阅读(163) 评论(0) 推荐(0) 编辑
摘要: key point: 字符串都是不可改变的 打印: >>> values('world', 'hot')>>> format'hello, %s. %s enough for ya'>>> print(format % values)hello, world. hot enough for ya > 阅读全文
posted @ 2019-06-24 16:02 嵌入式实操 阅读(172) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 55 下一页