ICode9

精准搜索请尝试: 精确搜索
  • 《流畅的python 第一章 python数据模型》2021-12-18 12:02:24

    第一章 python数据模型 摘要:本章主要讲一些特殊方法(前后带双下划线写法的方法,如__len__,__getitem__),为什么有特殊方法,特殊方法的应用。 特殊方法 python是一种面向对象语言,那么为什么会有len(x)这种写法,而不是x.len()呢 Python 解释器遇到len()这种特殊句法时,会使用特殊方法去

  • 一摞Python风格纸牌2021-09-05 20:31:21

    import collections # 引入collections模块 Card = collections.namedtuple('Card', ['rank', 'suit']) # 用namedtuple创造了一个简单的类Card class FrenchDeck: ranks = [str(n) for n in range(2, 11)] + list('JQKA') # 使用列表操作生成字符串

  • Python3 sorted() 函数2021-07-26 22:34:01

    定义: def sorted(*args, **kwargs): # real signature unknown """ Return a new list containing all items from the iterable in ascending order. A custom key function can be supplied to customize the sort order, and the reve

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有