Print string without single quotes & brackets

It sounds like country.currencies() returns a list, which is why you see ['CAD']. In order to access the first (and only) element in the list, which is a string, you can use currency[0]. To print it, you can use print(currency[0]), which will give the desired output.

I would strongly suggest reading about lists, what you can put inside of them, and most importantly, how you can access elements in them.

Browse More Popular Posts

Leave a Comment