The basic IronPython type, IronPython type

Source: Internet
Author: User

The basic IronPython type, IronPython type

By presenting the basic types of IronPython, it is easy to understand and remember.

 

 

 

Basic Data Type

 

Data Type

Type

Example

Remarks

Byte string

Str

'Hello'

"Hello"

"Hello """

'''Hello '''

In IronPython, byte string and unicode string are of the same data type.

Unicode string

Unicode

U'hello'

U "hello"

U "hello """

 

Integer

Int

3

-3

 

Long integer

Long

3L

 

Floating point

Float

0.0

-3

 

Complex number

Complex

2 + 3j

 

List

List

[]

[1, 2, 3]

[1, 'A', 3]

 

Tuple

Tuple

()

(2 ,)

(1, 2)

 

Dict

Dict

{}

{"Key": 'value '}

 

Set

Set

Set ()

Set ([1, 2, 4])

 

None

None

 

It is synonymous with NULL in C #.

Boolean

Bool

True

False

 

 

Note:

1. Both str and unicode are based on basestring. to check whether the object is of the string type, you can use isinstance (someObject, basestring)

2. The values below are False in IronPython:

False and None

0 (int, long, float)

Empty string (str, unicode)

Empty set, list, tuple, dict

 

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.