Adding letters/strings to each element in a Python list

Published: 07 March 2022
on channel: ExplainHowToSimply
1,497
8

This short Python tutorial shows how to simply add letters or strings to each element in a Python list. In the video I use an example with company tickers to add the Bloomberg addition "US Equity" for US companies to each ticker symbol. Additionally, I replace the spaces with bottom lines with the same Python command.

It is the following command:
[x + 'US Equity' for x in list]


On this page of the site you can watch the video online Adding letters/strings to each element in a Python list with a duration of hours minute second in good quality, which was uploaded by the user ExplainHowToSimply 07 March 2022, share the link with friends and acquaintances, this video has already been watched 1,497 times on youtube and it was liked by 8 viewers. Enjoy your viewing!