Pair Programming 1-Beginner Python language

Source: Internet
Author: User

As the group of gay whim, intends to use the popular Python language to complete our pair programming project, I also take the opportunity to learn Python syntax details and characteristics. However, converting from the C + + language to Python is a challenging task.

First, Python has a special syntax format: indentation. The execution code, unlike the IF, while condition, is identified by the curly braces {}, and Python represents this hierarchical relationship in the form of indentation. For example:

1 ifA>B:2max=a3Print"the larger person is%d"%max)4 elifa<B:5max=b6Print"the larger person is%d"%max)7 Else:8Print"The two are the same size")

Also, you will find that the conditional parentheses () that follow the If are not there, instead of the colon. In addition, some of the nuances of grammar are different from the language we were exposed to earlier.

In Python, when we declare a variable, we don't have to indicate whether its data type is int or float or string, and the interpreter automatically chooses the data type based on its value, which gives the program ape a lot of convenience.

The Python library also has a lot of handy functions for manipulating strings, and we can use them directly without having to code a lot of lines to implement this function.

Next week, my team and I will continue to learn more about the Python language, and will combine our respective code into a modular, arithmetic expression to achieve the automatic generation and calculation functions.

Pair Programming 1-Beginner Python language

Related Article

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.