# Method 1
list(df)
# Method 2
df.columns.values.tolist()
# Method 3 - list comprehension
[col for col in df]
# Import pandas package
import pandas as pd
# making data frame
data = pd.read_csv("nba.csv")
# iterating the columns
for col in data.columns:
print(col)
# to print the columns
print(df.columns)