Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to unpack a list inside placeholder { } in python

I have a list of strings, name, ignore_stock. I want to display it in a telegram bot message. Presently, I am displaying it like this:

update.message.reply_text(f'<b>Following stocks are ignored: {ignore_stock}</b>', parse_mode='HTML')

This displays the list like this: [‘a’,’b’,’c’] inside the telegram bot message.

I want to display the list like this: a, b, c inside the telegram bot message without [ ] and ”. How do I do that?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

thanks in advance

>Solution :

Try replacing {ignore_stock} with {",".join(ignore_stock)}

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading