LoslegenKostenlos loslegen

Lists

Stocks in the S&P 100 are selected to represent sector balance and market capitalization. To begin, let's take a look at what data we have associated with S&P companies.

Four lists, names, prices, earnings, and sectors, are available in your workspace.

Diese Übung ist Teil des Kurses

Introduction to Python for Finance

Kurs anzeigen

Anleitung zur Übung

  • Print the first four items in names.
  • Print the name, price, earning, and sector associated with the last company in the lists.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# First four items of names
print(names[____])

# Print information on last company
print(names[____])
print(prices[____])
print(earnings[____])
print(sectors[____])
Code bearbeiten und ausführen