List returning extra brackets in results

posted by iup85 on 2009-07-01 08:51:07
Hello,
I am getting extra brackets in my results, this is what I get:
 
>>> print valules
[[41], [21], [5], [5], [10], [5], [7]]
 
How can I get the result without the extra bracket at the beginning and at the end?
Thanks.
ryan714
1
Hi, ok so this is valules:
 valules = [[41], [21], [5], [5], [10], [5], [7]]
You can do this to take off the extra beginning and ending bracket:
 
>>> print ", ".join(str(x) for x in valules)
[41], [21], [5], [5], [10], [5], [7]
 
1 answers - 0 questions
+ 1  Positive        Negative



Answer the question



Top Users
  • dail (12)
  • livin52 (3)
  • camu (3)
  • softweb (2)
  • Nadine (1)
  • Josware (1)
  • lfelipecr (1)
  • gregoriohc (1)
  • Mitu (1)
  • ryan714 (1)