Learning Python Course: Clear, Concise and Effective Programming For Dummies-Professional

0
(0)

Learning Python Course: Clear, Concise and Effective Programming For Dummies-Professional
 

  • Author:Engr. Michael David
  • Edition: 1
  • Publication Date: 2020-12-17
  • ISBN-10: B08QZX7LKK
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Python is a high-level scripting language which can be used for a wide variety of text processing, system administration and internet-related tasks. Unlike many similar languages, it’s core language is very small and easy to mas-ter, while allowing the addition of modules to perform a virtually limitless variety of tasks. Python is a true object-oriented language, and is available on a wide variety of platforms. There’s even a python interpreter written entirely in Java, further enhancing python’s position as an excellent solution for internet-based problems.

    Python was developed in the early 1990’s by Guido van Rossum, then at CWI in Amsterdam, and currently at CNRI in Virginia. In some ways, python grew out of a project to design a computer language which would be easy for beginners to learn, yet would be powerful enough for even advanced users. This heritage is reflected in python’s small, clean syntax and the thor-oughness of the implementation of ideas like object-oriented programming, without eliminating the ability to program in a more traditional style. So python is an excellent choice as a first programming language without sacri-ficing the power and advanced capabilities that users will eventually need.

    Although pictures of snakes often appear on python books and websites, the name is derived from Guido van Rossum’s favorite TV show, “Monty Python’s Flying Circus”. For this reason, lots of online and print documen-tation for the language has a light and humorous touch. Interestingly, many experienced programmers report that python has brought back a lot of the fun they used to have programming, so van Rossum’s inspiration may be well expressed in the language itself.

    The very Basics of Python

    There are a few features of python which are different than other program-ming languages, and which should be mentioned early on so that subsequent examples don’t seem confusing. Further information on all of these features will be provided later, when the topics are covered in depth.

    Python statements do not need to end with a special character – the python interpreter knows that you are done with an individual statement by the presence of a newline, which will be generated when you press the “Return” key of your keyboard. If a statement spans more than one line, the safest course of action is to use a backslash () at the end of the line to let python know that you are going to continue the statement on the next line; you can continue using backslashes on additional continuation lines. (There are situations where the backslashes are not needed which will be discussed later.)

    Python provides you with a certain level of freedom when composing a program, but there are some rules which must always be obeyed. One of these rules, which some people find very surprising, is that python uses in-dentation (that is, the amount of white space before the statement itself) to indicate the presence of loops, instead of using delimiters like curly braces ({}) or keywords (like “begin” and “end”) as in many other languages. The amount of indentation you use is not important, but it must be consistent within a given depth of a loop, and statements which are not indented must begin in the first column. Most python programmers prefer to use an edi-tor like emacs, which automatically provides consistent indentation; you will probably find it easier to maintain your programs if you use consistent in-dentation in every loop, at all depths, and an intelligent editor is very useful in achieving this.

    中文:

    书名:学习Python课程:面向专业人士的清晰、简洁和有效的编程

    Python是一种高级脚本语言,可用于各种文本处理、系统管理和与互联网相关的任务。与许多类似的语言不同,它的核心语言非常小,易于处理,同时允许添加模块来执行几乎无限的各种任务。Python是一种真正的面向对象语言,可在多种平台上使用。甚至还有一个完全用Java编写的Python解释器,进一步增强了它作为解决基于互联网的问题的优秀解决方案的地位。

    20世纪90年代初,Guido van Rossum在阿姆斯特丹的CWI开发了Python,目前在弗吉尼亚州的CNRI。在某种程度上,Python诞生于一个旨在设计一种计算机语言的项目,该语言对初学者来说很容易学习,但即使是高级用户也足够强大。这一传统体现在Python的简洁语法和面向对象编程等思想的实现上,而不是消除了以更传统的风格进行编程的能力。因此,在不牺牲用户最终需要的功能和高级功能的情况下,作为第一编程语言,Python是一个很好的选择。

    尽管蛇的图片经常出现在蟒蛇的书籍和网站上,但这个名字源于Guido van Rossum最喜欢的电视节目《巨蟒的飞行马戏团》。出于这个原因,许多在线和印刷的语言文献都有一种轻松幽默的感觉。有趣的是,许多有经验的程序员报告说,Python带回了他们过去编程时的许多乐趣,因此van Rossum的灵感可能用语言本身很好地表达了出来。

    Python的基础知识

    ff有一些不同于其他编程语言的特性,这些特性应该在早期提到,这样后面的例子就不会让人感到困惑。有关所有这些功能的更多信息将在稍后深入讨论这些主题时提供。

    Python语句不需要以特殊字符结尾–如果您按下键盘上的“Return”键,换行符就会生成,从而知道您已经完成了单个语句。如果一条语句跨越多行,最安全的做法是在该行的末尾使用反斜杠(),以便让Python知道您将在下一行继续执行该语句;您可以在其他继续行上继续使用反斜杠。(有些情况下不需要反斜杠,这将在后面讨论。)

    在编写程序时,Python为您提供了一定程度的自由,但有一些规则必须始终遵守。有些人觉得非常奇怪的一条规则是,Python使用内切(即语句本身前面的空白量)来指示循环的存在,而不是像在许多其他语言中那样使用花括号({})或关键字(如“Begin”和“End”)之类的分隔符。您使用的缩进量并不重要,但它必须在给定的循环深度内保持一致,并且未缩进的语句必须从第一列开始。大多数Python程序员更喜欢使用像emacs这样的EDI-tor,它会自动提供一致的缩进;如果在每个循环中、在所有深度使用一致的缩进,您可能会发现更容易维护程序,而智能编辑器在实现这一点方面非常有用。

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册