上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 72 下一页
摘要: Figure is the object with the highest level in the hierarchy. It corresponds to the entire graphical representation and generally can contain many Axe 阅读全文
posted @ 2017-07-02 17:40 2021年的顺遂平安君 阅读(852) 评论(0) 推荐(1)
摘要: 随机产生0~7之间的 整数 , 不包含7 。 随机从 中产生5个数,放入一个 list 。 从 中随便挑选一个元素。 对 中的元素进行重新洗牌。洗牌之后 中元素的排列顺序随机发生变化 。 阅读全文
posted @ 2017-07-02 15:16 2021年的顺遂平安君 阅读(336) 评论(0) 推荐(0)
摘要: random.randrange(1,10) 随机产生0~7之间的整数,不包含7。 random.sample(range(100), 5) 随机从range(100)中产生5个数,放入一个list。 random.choice() possib... 阅读全文
posted @ 2017-07-02 15:16 2021年的顺遂平安君 阅读(68) 评论(0) 推荐(0)
摘要: Pythonsorted()函数中可以加入key=参数。作用是每个元素在排序之前,先作为key=中FUNCTION的参数,用FUNCTION的输出结果作为依据来排序。 print (sorted("This is a test string from D... 阅读全文
posted @ 2017-07-02 14:48 2021年的顺遂平安君 阅读(71) 评论(0) 推荐(0)
摘要: Python 函数中可以加入 参数。作用是每个元素在排序之前,先作为 中 FUNCTION 的参数,用 FUNCTION 的输出结果作为依据来排序。 输出结果: 这里定义了一个 的函数。把一个 list 作为输入参数 student ,返回list中的第1个元素 。 阅读全文
posted @ 2017-07-02 14:48 2021年的顺遂平安君 阅读(201) 评论(0) 推荐(0)
摘要: 拆开Tuple 交换位置 使用 Tuple 可以方便的交换两个数的位置,不用设临时变量。 阅读全文
posted @ 2017-07-01 21:14 2021年的顺遂平安君 阅读(245) 评论(0) 推荐(0)
摘要: 拆开Tuple lax_coordinates = (33.9425, -118.408056)latitude, longitude = lax_coordinates # tuple unpacking 交换位置 variable = (10,2... 阅读全文
posted @ 2017-07-01 21:14 2021年的顺遂平安君 阅读(58) 评论(0) 推荐(0)
摘要: class aTest: def __repr__(self): return "This is an aTest class."a = aTest()print (a)class bTest: passb = bTest()pr... 阅读全文
posted @ 2017-07-01 18:36 2021年的顺遂平安君 阅读(51) 评论(0) 推荐(0)
摘要: 输出结果: 所以, 决定了直接打印一个实例时输出的字符串。 阅读全文
posted @ 2017-07-01 18:36 2021年的顺遂平安君 阅读(141) 评论(0) 推荐(0)
摘要: The first thing to know about special methods is that they are meant to be called by the Python interpreter, and not by you. You don’t write my_object 阅读全文
posted @ 2017-07-01 18:25 2021年的顺遂平安君 阅读(369) 评论(0) 推荐(0)
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 72 下一页