Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

back to contents

Python: sequence

↑ top




list

#!/usr/bin/python -u

if __name__ == "__main__":
    li = []
    li.append("A")
    li.append(1)
    li.append([1,2,3])
    li = li + ["X", "Y"]
    print li
    # ['A', 1, [1, 2, 3], 'X', 'Y']

↑ top




immutable tuple

#!/usr/bin/python -u

if __name__ == "__main__":
    ti = (1,2,3)
    print ti
    # (1, 2, 3)

↑ top