python-Basic Knowledge

Source: Internet
Author: User

A variable and a simple data type

1. The variable name contains a letter/number/underscore and cannot begin with a number.

2. String processing: String single-cited double-cited can be;

A.title ()//capitalize the first letter of the word in string A;

A.upper ()//change the string to full capitalization;

A.lower ()//change the string to full lowercase;

A.rstrip ()//delete whitespace at the end of the string;

A.lstrip ()//delete whitespace at the beginning of the string;

A.rstrip ()//delete whitespace at both ends of the string;

The apostrophe is located between the two primers,

3. Digital

A. 3**2 expression of powers, 9;

B. The number of decimal places of floating-point numbers is uncertain;

>>> 0.1+1.3
1.4000000000000001
C. Change the integer type to a string;

STR (a)//the non-string is represented as a string;

D. 3/2 The result is 1, rounding only; 3.0/3 result is 1.5; at least one floating point

Two lists

python-Basic Knowledge

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.