7921 Star!Python学习的必备法宝,随查随用,太方便了吧

域名2025-11-04 22:48:5534

 

大多数的学习cheatsheet都是简单的语法规则列表,如果你手头有一份cheatsheet会让你的备法宝随工作效率大大提升。

近日,查随有一叫Python-cheatsheet项目在Hacker News、用太Reddit、学习Github等网站上成功引起了广大程序员的备法宝随注意。

Python-cheatsheet是查随一份超全的Python速查表,最大的用太特点就是免费源码下载你无需安装和配置,在线就能使用,学习内容十分全面 

目前,备法宝随python-cheatsheet已经过在Github上获得 7885个Star,查随1572个Fork(Github地址:https://github.com/gto76/python-cheatsheet) 

 

清单的用太开头就对这份内容进行一个梳理,可以看出内容涵盖:容器、学习类型、备法宝随语法、查随系统、数据、库,以及Advanced Python等。你只要点击相关知识点,就会跳转到相关的WordPress模板详情页,下面以Main和List为例

Main

if __name__ == __main__:     # Runs main() if file wasnt imported.

    main()

List

 = [from_inclusive : to_exclusive : ±step_size]

.append()            # Or:  += []

.extend()    # Or:  += 

.sort()

.reverse()

 = sorted()

 = reversed()

sum_of_elements  = sum()

elementwise_sum  = [sum(pair) for pair in zip(list_a, list_b)]

sorted_by_second = sorted(, key=lambda el: el[1])

sorted_by_both   = sorted(, key=lambda el: (el[1], el[0]))

flatter_list     = list(itertools.chain.from_iterable())

product_of_elems = functools.reduce(lambda out, x: out * x, )

list_of_chars    = list()

index = .index()     # Returns index of first occurrence or raises ValueError.

.insert(index, )     # Inserts item at index and moves the rest to the right.

 = .pop([index])     # Removes and returns item at index or from the end.

.remove()            # Removes first occurrence of item or raises ValueError.

.clear()                 # Removes all items. Also works on dict and set.

整份文档基本都是代码,只有个别内容会添加一些简短的文字说明,对于用法创建者为了减少使用者的负担,只给了最常见的用法,用最简洁的方式给你最需要的用法

如果你不想在线使用该文档,你也可以下载文本,下载地址:https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md

项目地址:https://github.com/gto76/python-cheatsheet

本文地址:http://www.bzve.cn/html/329a66699004.html
版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

全站热门

键盘之错(纠正错误,展开思维)

CSS进阶:提高你前端水平的4个技巧

2017年前端开发工具趋势

消息总线能否实现消息必达?

电脑安装无损分区教程(一步步教你如何在电脑上进行无损分区,保护你的数据安全)

Flexbox模块所有基本概念及特点

如果人工智能泡沫破灭了

隔离术之使用Hystrix实现隔离

友情链接

滇ICP备2023006006号-39