Python lesson Three: Installing Pycharm, data type first knowledge

Source: Internet
Author: User
Tags linux text editor

Content of the previous section
Variable
If Else
Note # ' msg '
3 quotation marks to print multiple lines
', ' The meaning of double single quotes is the same

Indent in


The content of this section
Pycharm use
Integrated development Environment (IDE, Integrated development environment)
VIM #经典的linux下的文本编辑器
Emacs #linux text Editor, easier to use than vim
Eclipse # Java IDE, support for Python, C, C + +
Visual Studio # Microsoft developed IDE, python,c++,java,c#
notepad++,
Developed by Sublime Python
Pycharm, which is the IDE used primarily for Python development

 Location Untitled unnamed fullstack full stack interpreter Interpreter

  

Character formatting output
Placeholder%s s = string
%d d = digit integer
%f f = Float floating-point number, approximately equal to decimal

Data operations
Initial knowledge of the data type
Digital
integers int (integer)
Integral type
Long integer type
In Py3 has no distinction between integral type and long integer type, unity is called integral type
In C int age, long
There are only 2 states of Boolean, namely
True true
False false

String
Salary.isdigit ()
Everything is an object in a computer.
All things in the world are objects, all objects can be classified


Loop loops
Limited cycle, frequency limit
Infinite loop = Dead loop
continue End this cycle, continue the next cycle
break jumps out of the entire current loop

For
While
Break, continue

Digital:

2 is an example of an integer. Long integers are just larger integers. 3.23 and 52.3E-4 are examples of floating-point numbers. The e tag represents a power of 10. Here, 52.3E-4 means 52.3 * 10-4. ( -5+4j) and (2.3-4.6j) are examples of complex numbers, where -5,4 is a real number, j is an imaginary number, and what is the plural in mathematics?

int (integral type)

On a 32-bit machine, the number of integers is 32 bits and the value range is -2**31~2**31-1, which is -2147483648~2147483647
On a 64-bit system, the number of integers is 64 bits and the value range is -2**63~2**63-1, which is -9223372036854775808~9223372036854775807long (Long integer)
Unlike the C language, Python's long integers do not refer to the positioning width, that is, Python does not limit the size of long integer values, but in fact, because of limited machine memory, we use a long integer value can not be infinite.
Note that, since Python2.2, Python automatically converts integer data to long integers if an integer overflows, so it does not cause any serious consequences if you do not add the letter L after long integer data.
Float (float type)        First Literacy http://www.cnblogs.com/alex3714/articles/5895848.html
A floating-point number is used to process real numbers, which are numbers with decimals. Similar to the double type in C, accounting for 8 bytes (64 bits), where 52 bits represent the bottom, 11 bits represent the exponent, and the remaining one represents the symbol.
Complex (plural)
The complex number consists of real and imaginary parts, the general form is X+yj, where x is the real part of the complex, and Y is the imaginary part of the complex, where x and y are real numbers. Note: Small number pools exist in Python:-5 ~ 257 2, Boolean true or False 1 or 03, string
"Hello World"

 

string concatenation of all evils: the string in Python is embodied in the C language as a character array, each time you create a string, you need to open a contiguous space in memory, and once you need to modify the string, you need to open up again, the evil + sign every occurrence will re-open a space within. String Formatted output
1 " Alex " 2 "  " % name3   4 #输出: I am Alex

PS: string is%s; integer%d; floating-point number%f

Python lesson Three: Installing Pycharm, data type first knowledge

Related Article

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.