6. learn-python
- url: https://github.com/trekhleb/learn-python
- star: 1.3w
- fork: 2.2k
- watch: 724
本免费教程是一份以代码和注释作讲解的Python学习资料。Python所有语法和知识点,都采用了实战代码为例进行讲解,配合注释和参考资料服用,让你快速上手掌握Python基础知识。
此项目既是新手学习Python的资料教程,也是未来回顾知识点时的速查表。
"""WHILE statement
@see: https://docs.python.org/3/tutorial/controlflow.html
@see: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement
The while loop executes as long as the condition remains true. In Python, like in C, any
non-zero integer value is true; zero is false. The condition may also be a string or list
value, in fact any sequence; anything with a non-zero length is true, empty sequences are
false.
The test used in the example is a simple comparison. The standard comparison operators are
written the same as in C: < (less than), > (greater than), == (equal to), <= (less than or
equal to), >= (greater than or equal to) and != (not equal to).
"""
def test_while_statement():
"""WHILE statement"""
# Let's raise the number to certain power using while loop.
number = 2
power = 5
result = 1
while power > 0:
result *= number
power -= 1
# 2^5 = 32
assert result == 32
7. practical-python
- url: https://github.com/dabeaz-course/practical-python
- star: 8k
- fork: 4.8k
- watch: 344
作者David Beazley是《Python Cookbook 第三版》、《Python 参考手册》的作者。该开源项目是Python的免费入门级教程,教程经过教学实践,包含课后练习。
教程目录如下:
8. PythonSpiderNotes
- url: https://github.com/lining0806/PythonSpiderNotes
- star: 5.9k
- fork: 2.1k
- watch: 385
Python爬虫的基础入门教程,从抓取、分析、存储三个板块讲解,对常用爬虫框架scrapy也做了详细介绍,适合新人爬手自学之用。
9. machine_learning_complete
- url: https://github.com/Nyandwi/machine_learning_complete
- star: 3.4k
- fork: 487
- watch: 67
基于Jupyter Notebook的机器学习教程库。包含30多个Jupyter Notebook的案例集合,涵盖机器学习所需的Python基础知识,数据清洗、数据挖掘、可视化分析相关的库和工具。
本项目还包含了主流的机器学习、NLP、计算机视觉算法,对于机器学习入门来说,是一份面面俱到的教程。
10. free-python-games
- url: https://github.com/grantjenks/free-python-games
- star: 2.5k
- fork: 1.1k
- watch: 101
这是一个Python游戏合集,都是入门级的简单小游戏,包括:贪吃蛇、迷宫、Pong、猜字等。
项目运行方便、简单易懂。适合用来开启用你的Python学习之旅,边玩边学,理解源码,寓教于乐。
安装运行:
pip install freegames
python -m freegames.snake # freegames.游戏名
上述的项目和学习资料可以先操练和学习起来,希望对正在学习python的朋友有所帮助。
在程序员的社交第一网站Github上,有着大量现成的练手项目。大家根据自己的需求找到相关项目,把代码pull下来,自己一行一行地抄一遍,融汇贯通后自己着手写写看。
只要练习够多,掌握一门语言并没有什么难度。
如果遇到任何疑问,可以在评论区给老K留言或者私信我。
码字不易,不要光收藏,记得也要点个赞!