1. 程式人生 > >python 3 元組

python 3 元組

1、建立元祖

tup1 = ('jenkins','mysql')
print(tup1)


ssh://[email protected]:22/usr/bin/python -u /home/progect/app/py_code/test1.py
('jenkins', 'mysql')

Process finished with exit code 0


2、訪問元祖

tup1 = ('jenkins','mysql')
print(tup1[0])

ssh://[email protected]:22/usr/bin/python -u /home/progect/app/py_code/test1.py
jenkins

Process finished with exit code 0