Python Road-----Study notes the next day

Source: Internet
Author: User

Variable name points:

1. Variable names can only contain letters, numbers, and underscores. Variable names can begin with a letter or underscore, but cannot begin with a number, for example, you can name a variable message_1, but you cannot name it 1_message.

2.  variable names cannot contain spaces, but you can use underscores to separate words in them.

3, python keywords and function names are used as variable names, i.e. do not use pythonprint  .

4, name than n good , student_name than s_n good, name_length ratio length_of_persons_name good.
/span>

5, Use the small Letter L and the capital letter O cautiously, because they may be mistaken for numbers 1 and 0.

python string variables in single and double quotes Do not make the request, can use, whatever you! But /span>

eliminate whitespace at both ends of the string method: Strip (), Rstrip (), Lstrip ()

want to use division in Python , at least one operand is a floating-point number.

The bank's circulation disk is very big, the big fund does not play the bank stock on the short-term goal, the Big Fund Investment Foundation must come from the fundamental change. the recovery and development of the bank's operating conditions. Will give such assets a big opportunity, which is medium and long-term, and now is the middle and long-term transition.

The delete pop operation of the list is the last element of the list to pop up the list! Del operation is not available after deletion!

Add elements at the end of the list, using the Append () operation! Specify the position of the increment operation, using Insert ()

Remove (): Deletes an element based on the value of the element in the list!

Sort list elements: List.sort () After sorting the list, the order of the list is permanently changed; sorted (list) is just a temporary change in order, the list does not change

Inverted Print List: List.reverse () print (list)

Determining the length of a list: Len (list)

Python Road-----Study notes the next day

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.