Python language variables 1 (numeric, String, Boolean)

Source: Internet
Author: User
Tags natural string

1. Values

integer : 2,-2

Long integer : 2**1024, 2**2048 (really can very ~ long ~ ~ ~, hand residual forget a 2**100000,idle really to fight out, ORZ)

floating point : 7.05, 1E2 (100.0), 2.3e4.5 (Invalid syntax)

plural : (1+2j), (1.2+3.4j), (1+1J) (must have parameter adornments in front of, otherwise unrecognized as plural)

Acomplex.real Acomplex.imag2

2. String

Interesting properties:

" Hello "+"  World,strhello World

quotation marks :

single quotation mark ('): ' Like ' this '

double quotation mark ("):" Like ' This "

three quotation marks ("or"""): Multiple lines of string, with the freedom to use single or double quotation marks in three quotation marks

escape character : \ (the end of the line indicates that the string continues on the next line)

Natural string : prefix plus R or R for Real

Unicode string : Prefix plus u or u

3. Boolean

True False

Print(3==5 )Print(3!=3 )Print("D">"e" )Print("H" inch "Hello" )Print("e"  not inch "Hello")

Python language variable 1 (numeric, String, Boolean)

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.