Learn Python with anger-Article 1-Understanding Python and python

Source: Internet
Author: User

Learn Python with anger-Article 1-Understanding Python and python

Python is an explanatory, interactive, and object-oriented scripting language. It was invented in 1989 by Guido van rosum, also known as the glue language, because it can easily connect other languages together. It was developed by ABC and combined with the idea of SmallTalk, C ++ and other languages. The source code also follows GPL.

I use Python 2.7 in Linux. Ubuntu is installed by default when the environment is set up.

Coding convention -- "Hello, world! ".

Python supports two programming methods.

The first type isInteractive Programming: Programming that can get the running result on one side of Coding,

The second type isScript-based programming: Write code in a document, save the document as a file suffixed with py, and run it using the python command,

PythonIdentifier: The rule is similar to C ++, but it is a little different. The identifier starting with an underscore such as "_ ex" is generally a private member, the underlines on both sides are generally the identifier of the Python-specific method. For example, "_ init _ ()" is the class constructor by default.

PythonReserved Words: Http://laiguowei2004.blog.163.com/blog/static/3682900020110611747142/

PythonCode block: Controls by indentation. The same code block must be indented.

PythonRow Control: Python usually uses rows to control the statement. line feed indicates that the statement ends.

Python";": You can use a semicolon to display multiple statements in a row, as shown in figure

ans = a; ans = ans + b; ans = ans + c;

Python"\": Can be used to display multiple rows in one statement.

ans = a + \      b + \      c

PythonQuotation marks: Python supports ', ", ''', and" "to define strings, which can be the same between left and right. For example

name = 'wyp'name = "wyp"name = '''wyp'''name = """wyp"""

Python"#": Used to start with a comment. Only line comments are supported. Fast comments are not supported, as shown in figure

name = 'wyp'#this is a string

Python":": Is used to form a code group (A group of statements with the same indentation and continuity). The following code, the first sentence with ":" and the following code group constitute a clause)

if name == 'wyp' :    ans = ans + 1else:    ans = ans - 1

 


Learn python

For more information, see python core programming version 2.
Or the cute python is pretty good.

These two books are available in PDF versions on the Internet.

Python for beginners

Hello, please let me answer your question. If you are new to Pyhon, we suggest you start with 2. x.

I started learning PYTHON this summer. I had a book that made me start very fast.
The score for "Python basics tutorial" is 8.2. The address is as follows:
Book.douban.com/subject/4866934/

It is very suitable for beginners. It is not only suitable for beginners who are familiar with PYTHON for the first time, but also suitable for later use as a tool book.
After introducing the basic features, network programming, file operations, xml/html, pygame (game), image processing, and so on will all be involved, so it is very suitable for beginners to have a comprehensive understanding of python, and finally there are many practical projects, let you feel the mysteries of python.

After reading this book carefully for a month, you may find it sufficient.
We recommend the next book "Python learning manual", which is rated as 8.4. The address is as follows:
Book.douban.com/subject/3948354/

Hope we can learn python together! At the same time, the python Group wishes you a pleasant programming!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.