python3.5 append使用

1、从元组中添加

friends=[]
tup1=("Jon",35)
friends.append(tup1[0])
print(friends[0])


ssh://root@192.168.0.204:22/usr/bin/python -u /home/progect/app/py_code/test1.py
jenkins



2、从循环中批量添加

str1=[]
for i in range(5):
str1.append(i)
print(str1)

ssh://root@192.168.0.204:22/usr/bin/python -u /home/progect/app/py_code/test1.py
[0, 1, 2, 3, 4]

























 

posted @ 2018-12-09 17:49  effortsing  阅读(232)  评论(0编辑  收藏  举报