python tuple or list is too long?

python tuple (tuple)

Similarly the Python tuples and lists, except that the elements of the tuple is not changed (and thus also called tuple read-only list), and the use of tuples and lists using parentheses in brackets;
1, contains only tuple when an element needs to be added after the element to disambiguate the comma;
2, element values in the tuple that the modifications are not allowed, but may be connected to a combination of tuples;
3, the elements of the tuple is not allowed to be deleted, del statement may be used to delete an entire tuple;
4, may be used between tuples * and +, a combination of which allows tuples copied repeatedly connected and, after calculation will generate a new tuple

tu = ((2,2),(3,3),(4,4),(5,5),(6,6),(8,8),(9,9))
if len(tu)>3:
    n = 0
    for tmp_N in range(0,len(tu)+1,4):
        print(tmp_N,"-->",tmp_N+4)
        tmp = tu[tmp_N:tmp_N+4]
        print(tmp)
https://www.cnblogs.com/duwenxing/p/7348561.html

Guess you like

Origin blog.51cto.com/11114389/2438810