1. Immutable sequence types: tuple, range, str, set
001: There are several ways to construct a tuple type
1, () constructs an empty tuple.
2, a | (A,) constructs a tuple of only one element.
3, tuple (' 1 ') is constructed using the built-in tuple method.
4, (three-way) use the literal value method to construct a tuple.
002: There are not so many tricks for range, only one method of construction available in range (start index, end index, step)
003:str is not too much of a pattern; it is mainly constructed with literal values, which can be caused by single quotes, double quotes, and three quotation marks.
#!/usr/bin/python#!coding:utf-8if __name__=="__main__": A=[[] forIinchRange (6)] [a[0]='Neeky'a[1]="Neeky"a[2]=" "Neeky" "a[3]="""Neeky""" #the form of three quotation marks can be used to span multiple lines. a[4]="""Neeky""""""Neeky""" #the string in Python can be concatenated without the + sign, just write it to a piece. A[5]= ('Neeky' 'Neeky')#you can span more than one line, even if it's not a three-quote, plus parenthesis. forXinchA:Printx
2. Variable sequence list,dict
Python sequence type