👤

Programowanie z Pythonem-Zadanie 4
Given a dictionary called stocks that contains both stock tickers and the corresponding stock prices, write code that prints out the formatted information in the table.

Expected output:
-----------------------
TICKER PRICE (USD)
-----------------------
AAPL 165.30
MSFT 330.59
FB 324.46
AMZN 3507.07
TSLA 1144.76
GOOGL 2837.95

stocks = {
'AAPL': 165.30,
'MSFT': 330.59,
'FB': 324.46,
'AMZN': 3507.07,
'TSLA': 1144.76,
'GOOGL': 2837.95
}


Odpowiedź :

Odpowiedź:

Zadanie zostało wykonane zgodnie z treścią, dane zostały wyświetlone w formie sformatowanej tabeli, pobierając dane ze słownika.

Kod źródłowy:

Kod znajduje się tutaj, bo były trudności z zamieszczeniem go tutaj: https://pastebin.com/H0N2HcjU

Zobacz obrazek SEBUSIEKP