Basic data type (1), data type (

Source: Internet
Author: User

Basic data type (1), data type (
I. Numbers

Integer int:

# On a 32-bit machine, the integer has 32 digits and the value range is-2 ** 31 ~ 2 ** 31-1, I .e.-2147483648 ~ 2147483647 # In 64-bit systems, the number of digits of an integer is 64-bit and the value range is-2 ** 63 ~ 2 ** 63-1, that is,-9223372036854775808 ~ 9223372036854775807

You can convert a string to a number:


 

 

 

 

 

 

 

2. String (important: join/find/split/strip/upper/lower/replace)

Common functions of strings:

  • Remove blank (strip)
  • Split)
  • Index

 

  • Slice

 

  • Length

 

 

 

1. capitalize

 

 

 

2. casefold

 

 

3. center

 

 

4. count

 

 

 

 

5. startswith

Endswith

 

 

 

6. find

 

7. format

 

 

8. isalnum

 

 

9. expandtabs

 

 

10. isalpha

 

 

11. isdecimal

 

 

 

12. isprintable

 

 

13. isspace

 

 

14. istitle title

 

 

15. join (important)

 

 

16. ljust must UST

 

 

17. islower lower

 

 

 

18. isupper upper

 

 

19. lstrip rstrip strip

 

 

 

20. maketrans

 

 

 

21. partition rpartition

 

 

22. split rsplit

 

 

23. splitlines

 

 

 

24. startswith endswith

 

 

 

 

25. swapcase

 

 

 

26. replace

 

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.