Hi,
I am just wondering if anyone can tell me how to do this :
Say I have a list like this :
listA = ['c','c','c','c','c','c']
and I want to print out the contents but I don't want to square brackets .... for example if I do :
print listA
I get ----> ['c','c','c','c','c','c']
But I just want this ------> 'c','c','c','c','c','c' to be saved as a string
Is this possible?
I didn't bother with CODE tags seeing as there is no real code here.
Thanks
2 1193 bvdet 2,851
Recognized Expert Moderator Specialist
The answer is .... YES. - >>> listA = ['c','c','c','c','c','c']
-
>>> ','.join(listA)
-
'c,c,c,c,c,c'
-
>>> print ','.join([repr(item) for item in listA])
-
'c','c','c','c','c','c'
-
>>>
Thanks ... that's it. Perfect.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jean-Fran?ois Lacrampe |
last post by:
Hello,
I've got two random number/statistics questions I'd like you to
review. My first question is not directly related to PHP, but will be
implemented in PHP, as explained in my second...
|
by: Stephan Diehl |
last post by:
A while ago, I've posted a recipie about finding a common prefix to a list
of strings. While the recipie itself is quite bad (I have to admit) and I
didn't know at that time that this problem was...
|
by: Torsten Mohr |
last post by:
Hi,
reading the documentation (and also from a hint from this NG)
i know now that there are some types that are not mutable.
But why is it this way?
From an overhead point of view i think...
|
by: fdsl ysnh |
last post by:
--- python-list-request@python.orgдµÀ:
> Send Python-list mailing list submissions to
> python-list@python.org
>
> To subscribe or unsubscribe via the World Wide Web,
> visit
>...
|
by: Psykarrd |
last post by:
I am trying to declare a string variable as an array of char's. the
code looks like this.
char name;
then when i try to use the variable it dosn't work, however i am not
sure you can use it...
| |
by: Michael B. |
last post by:
I was just thinking about this, specifically wondering if there's any
features that the C specification currently lacks, and which may be
included in some future standardization.
Of course, I...
|
by: Rano |
last post by:
/*
Hello,
I've got some troubles with a stupid program...
In fact, I just start with the C language and sometime
I don't understand how I really have to use malloc.
I've readden the FAQ...
|
by: Christoph Zwerschke |
last post by:
In Python, it is possible to multiply a string with a number:
>>> "hello"*3
'hellohellohello'
However, you can't multiply a string with another string:
>>> 'hello'*'world'
Traceback (most...
|
by: apprentice |
last post by:
Hello,
I'm writing an class library that I imagine people from different countries
might be interested in using, so I'm considering what needs to be provided
to support foreign languages,...
|
by: Fred |
last post by:
Hi:
I've got the following request: (suppose the required head file
is included)
vector<stringvec;
// ..........
// push some items into vec
string str; // here I want to
copy some range...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |