FAQ
"Alastair G. Hogge" <agh at tpg.com.au> wrote in message
news:3f3b9080 at dnews.tpgi.com.au...
So basicly final_qu would be ('1','two','hello','2003-08-14','23:32:07')
However has stated above type(final_qu) return tuple.
If final_qu is already a tuple of strings, and what you need is one string
with each string in the tuple concatenated, then you can do this:
final_qu = ('1','two','hello','2003-08-14','23:32:07')
final_qu_str = ' '.join(final_qu)
final_qu_str
'1 two hello 2003-08-14 23:32:07'
>>>

If you can't guarantee that each tuple element is a string, try this:
final_qu_str = ' '.join([str(e) for e in final_qu])
final_qu_str
'1 two hello 2003-08-14 23:32:07'
>>>

[str(e) for e in final_qu] creates a list of a strings from the elements in
final_qu.

HTH
Sean

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 6 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 14, '03 at 1:37p
activeAug 18, '03 at 3:23a
posts6
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase