Python two, Python process-oriented programming Quick Start

Source: Internet
Author: User
Tags arithmetic operators logical operators

First, the data structure

program = data structure + algorithm

Data:

A collection of data elements that are organized in a way, such as numbering elements , that can be numbers or characters, or even other data structures.

The most basic data structure of Python is the sequence

Each element in the sequence is assigned an ordinal (that is, the position of the element) and also the index: index numbering starts at 0

Python contains 6 built-in data series: List, Ganso, String, Unicode string, Buff object, and Xrange object


Ii. key elements of Python

Basic data types

Object reference

Combining data types

logical operators

Control flow Statements

Arithmetic operators

Input/Output

Creation and invocation of functions


1. Basic data types in Python

Any programming language must be able to represent basic data items

The basic data types in Python are:

Integral type:

Integral type: Immutable type

-257.20162

Boolean type:

True,false

Floating-point types:

Floating point number:

3.141592

Plural:

3+6j

Decimal digits:

String

' GNU is not Unix ', ' Hello '


2. Object reference (variable)

Python saves all data as a Memory object

In Python, a variable actually refers to a reference to a Memory object

Dynamic type:

At any point in time, an object reference can re-reference a different object (with different data types) whenever necessary.

The built -in function type () is used to return the data type of a given data item

"=" is used to bind a variable name to an object in memory: If the object exists beforehand, it is bound directly; otherwise, the referenced object is created by "="

n [1]: a= ' mageedu ' in [2]: Type (a) out[2]: Strin [3]: a=3.14in [4]: Type (a) out[4]: Floatin [5]:


This article is from the "Xiexiaojun" blog, make sure to keep this source http://xiexiaojun.blog.51cto.com/2305291/1845688

Python two, Python process-oriented programming Quick Start

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.