Flash IOUs to pay the cash method, where you can whitewashed strip for cash

Flower chanting white striped \ / channel service: [331,575,644], staging music withdrawal, XIN mention card seconds ,, to staging, ease flowers, wayward pay various threshold withdrawals, flower chanting, white bars \ / Service letter: [315756443] professional second back section quickly, the operation can be face to face, a remotely operable! Quick and simple payment process, operating without professional card to get a few minutes alone!

Background
see the students very persistent with tuple, think of yourself just learning python, is very fond of tuple, why? Because the data is never seen before the way it is (1,2), very special feeling, it is also very easy to use with i, j = (1,2), and it would give a two variables;

And if the function returns a value of more than one, then use tuple very good, directly on the return, it is also easy to resolve.

But tuple Why so good? It is really so good? Really so good, why are rarely used such as what json tuple it? Not ponder too.

Explore
so we want to engage in quite understand why design a tuple, how should I use?

Quguan network search to find why are there separate tuple and list data types, feeling a little bit.

Generally write about understanding:

tuple and the list is very similar, but the basic usefulness is not the same.

tuple's design is similar to Pascal records or C structs (the two are not familiar ...);

It is what?

Collection of data associated with a set of
small-scale collection of
these types of data may be different
, but together are a combination of
a typical application, the Cartesian coordinate system, (x, y, z) denotes a coordinates of the object. Appears to be very intuitive, it is intuitive than the list, dict.

Another point, tuple is immutable type, that is, once the definition of tuple, the data inside it can not be changed. such as:

A = >>> (1,2)
>>> A [0] =. 3
Traceback (MOST Recent Last Call):
File "<stdin>", Line. 1, in <Module1>
TypeError: 'tuple' Object does Not Support the Assignment Item
>>> a [0]
1
I define a tuple a, I want to change it the first value, but being given a 'tuple' object does not support item assignment, in fact, suggests that this was wrong, a inside value can not be changed.

If you want to change, it is better to change the definition of a list, this list is mutable, that can arbitrarily change the value inside, this we are basically familiar with the commonly used.

Summary
tuple use of relatively cool place to have a few, in my own feelings:

Combination (group) feel better, as its design, tuple is to combine several related on behalf of a thing / thing
I understand is that this combination of things, there is a specific meaningful things, For example a Cartesian coordinate system
parsing more convenient time, such as, one line of code can be obtained two variables
>>> I, J = (. 1, 2)
>>> I
. 1
>>> J
2
Similarly, a design function , need to return multiple variables, they can use list, but you can also use tuple, when resolved we will have a piece of the top convenience.
Add that, because tuple is immutable, it can be used as dictionary (dict) to use the key, because the dictionary is used hashtable key to achieve, it is not (the) change.
There Sha? Temporarily did not think
that feeling is more important do not recommend the use of local tuple:

Guess you like

Origin www.cnblogs.com/dfdf55/p/12113740.html