python去list的括号

 我来答
Robeanithe
2013-11-04 · TA获得超过172个赞
知道答主
回答量:33
采纳率:0%
帮助的人:41.2万
展开全部
Hey guei,
I think now I know what you want
You mus thave a function like this

def func(*args, **argv):
......

So now, you can pass however much parameters to it.
What if you don't know have many you are gonna have when calling it?
Well, you need a list (or dict) and have to unpack it.
Just do like this:

aList = ['param1', 'param2', .... 'paramn']

func(*aList)

See, pretty easy, '*' is for unpacking in python.

Have fun

Old answer:
If you directly print a list , then the brackets are always there.
Normaly, you can print the content of a list like this

for i in aList:
print i,
print

This will print all the content with a space seperating them.
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
肖昀
2013-10-30 · TA获得超过498个赞
知道小有建树答主
回答量:419
采纳率:0%
帮助的人:110万
展开全部
给点例子,不是很明白你的意思
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式