美文网首页
Python为何值得学习

Python为何值得学习

作者: CoryLiu | 来源:发表于2019-11-21 22:47 被阅读0次

上周五SOHO中国董事长潘石屹在微博上宣布,开始学习一门新的语言Python。
一石激起千层浪,我心里的。

作为一个IT老兵,之前学的那些程序语言,如汇编,Basic, C, Pascal, Foxpro, Progress, TL, VB,Delphi,不是被我忘记了,就是被别人忘记了。

是时候要来学习一门新的编程语言了。

Python诞生于1991,由荷兰人吉多·范罗苏姆(Guido van Rossum)

Python是一种解释型脚本语言,可它不像其他如脚本语言,如VB Script那样只能执行简单的任务,相反,Python语言功能相当强大,可以广泛应用于几乎所有编程领域,如:

  • Web 和 Internet开发
  • 科学计算和统计
  • 人工智能
  • 教育
  • 桌面界面开发
  • 软件开发
  • 后端开发

当然,这里面最重要的是人工智能和大数据分析,这也是Python最近几年这么火爆的原因。

Python的设计哲学是“优雅”、“明确”、“简单”, 从下面的Python之禅可以看出:

Beautiful is better than ugly.
优美胜于丑陋。

Explicit is better than implicit.
显式胜于隐式。

Simple is better than complex.
简单胜于复杂。

Complex is better than complicated.
复杂胜于难懂。

Flat is better than nested.
扁平胜于嵌套。

Sparse is better than dense.
分散胜于密集。

Readability counts.
可读性应当被重视。

Special cases aren’t special enough to break the rules. Although practicality beats purity.
尽管实用性会打败纯粹性,特例也不能凌驾于规则之上。

Errors should never pass silently. Unless explicitly silenced.
除非明确地使其沉默,错误永远不应该默默地溜走。

In the face of ambiguity, refuse the temptation to guess.
面对不明确的定义,拒绝猜测的诱惑。

There should be one– and preferably only one –obvious way to do it.
用一种方法,最好只有一种方法来做一件事。

Although that way way not be obvious at first unless you’re Dutch.
虽然一开始这种方法并不是显而易见的,但谁叫你不是Python之父呢。

Now is better than never. Although never is often better than right now.
做比不做好,但立马去做有时还不如不做。

If the implementation is hard to explain, it’s a bad idea.
如果实现很难说明,那它是个坏想法。

If the implementation is easy to explain, it may be a good idea.
如果实现容易解释,那它有可能是个好想法。

Namespaces are one honking great idea – let’s do more of those!
命名空间是个绝妙的想法,让我们多多地使用它们吧!

最后给大家写一个hello, world. 让大家体会一下Python语言的简洁。

print("hello,world")

参考资料:
Python百度百科
Python documents

相关文章

网友评论

      本文标题:Python为何值得学习

      本文链接:https://www.haomeiwen.com/subject/sujxwctx.html