I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7Q5H9438L I tried ans=answer.split(",") to remove commas but it didn't work.
Jump to Post
>>> answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') >>> ''.join(answer) '7Q5H9438L' >>>
All 7 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.