I'm currently learning some aspects of PEP8 and Python programming in general. Could you please code-review this little piece of code for me? I would be glad to hear any, even the smallest comments, thanks!
from array import array
from typing import NamedTuple
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
savedTokensArray = ['bitcoin', 'ethereum']
class CryptoCurrency(NamedTuple):
currencyName: str
currencyPrice: float
def get_tokens_price(tokenIds: array) -> dict[str, float]:
tokens = None
for token in tokenIds:
tokens = f'{tokens}, {token}'
tokensList = cg.get_price(ids=tokens, vs_currencies='usd')
data = [CryptoCurrency(currencyName=currency, currencyPrice=tokensList[currency]['usd']) for currency in tokensList]
currencysDict = {}
for token in data:
currencysDict[token.currencyName] = token.currencyPrice
return currencysDict
resultDict = get_tokens_price(savedTokensArray)
print(resultDict)