0
# print the entire list of items
NBAfile = open ('NBA-Attendance-2015.txt', 'r')

for items in NBAlist: 

# Print out the team name, total attendance, average attendance, and capacity 
# with appropriate formatting 

print('The overall attendance at {0} was {1:,}, average attendance was {2:,} and the capacity was {3:.2f}%'.format(items[0], int(items[1]), int(items[2]), float(items[3])))

# Close the file 
NBAfile.close()

I tried the codes and got the error:

print('The overall attendance at {0} was {1:,}, average attendance was {2:,} and the capacity was {3:.2f}%'.format(items[0], int(items[1]), int(items[2]), float(items[3])))
    ^
IndentationError: expected an indented block
It_is_Chris
  • 13,504
  • 2
  • 23
  • 41
Tye N
  • 1

0 Answers0