Python Learning-data type (INT;FLOAT;BOOL;STR)

Source: Internet
Author: User

1/Data manipulation

* operator

The integer type is an addition operation, and the string is a merge operation.

-integer type is the subtraction operation

Integer is a multiplication, and the string is a repeating operation.

Integer division operations retain only integers, floating-point number divisions retain floating-point numbers

%; Integer division takes remainder operation

* *; Integer power operation

> greater than, note that different types cannot be compared

< less than, note that different types cannot be compared

= = equals, note that different types cannot be compared

! =; Not equal, note different types cannot compare

=; Assign a value

*round () rounding, configurable reserved decimal digits parameter

1 Round (2.6)2 > 33 round (2.3)4 > 25 round (2.6 , 0) 6 > 3.07 Round (2.6, 1)8 > 2.6

*type () to determine the data type function

1 type (123)2int3 type ('abc') 4 Str 5 Type (3.2)6 float

*len () Number of statistics strings

1 ' ABC ' 2 Len (a) 3 345 len ('abc')6 3

*or;

1TureorTure2>Ture3TureorFalse4>Ture5 false ro False6>False7 8Ture andTure9>TureTenTure andFalse One>False AFalse andFalse -> False
2/int integer

Integer

3/float floating Point

Decimal

4/bool Boolean value

*true the right

*false the wrong

Python Learning-data type (INT;FLOAT;BOOL;STR)

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.