Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deque to string in Python 3
#2
(Jun-11-2020, 05:07 AM)anthares Wrote: In Python3 I get an error.
what error do you get? Post full traceback in error tags
Please provide example of the data in the deque.

from collections import deque

foo = deque(['a', 'b', 'c'])
print(''.join(foo))
Output:
abc
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Deque to string in Python 3 - by anthares - Jun-11-2020, 05:07 AM
RE: Deque to string in Python 3 - by buran - Jun-11-2020, 05:17 AM
RE: Deque to string in Python 3 - by anthares - Jun-11-2020, 05:28 AM
RE: Deque to string in Python 3 - by buran - Jun-11-2020, 05:32 AM
RE: Deque to string in Python 3 - by anthares - Jun-11-2020, 06:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  If you deque a list, can it still be indexed? netrate 6 10,493 Nov-07-2016, 12:19 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020