0
  NBAfile = open ('nbafile.txt', 'r')

  count = 0

   NBAList = []
   for line in NBAfile:
   textline=line.strip()
   items = textline.split()
   NBAList.append(items)

    team, att, price = NBAList[0]


 attendances = []
 for line in NBAList:
     attendances.append(int(line[1]))

   prices = []
   for (team, att, price) in NBAList:
  prices.append(float(price))



   teams = []
    for (team, att, price) in NBAList:
        teams.append(team)


  'In the City of %s the number of people who attended were %s and the cost 
    of a ticket was %s' %(teams, attendances, prices)

I am trying to use formatted strings which i think i did to create the sentence at the end it keeps giving me the list instead of separating it out. like below

     [20.06, 22.54, 17.0, 21.98, 19.63, 17.05, 17.4, 24.42, 17.04, 17.56, 
      13.77, 21.95, 29.18, 17.6, 14.08, 10.92, 13.31, 22.7, 20.47, 19.04, 
      16.59, 22.19, 16.96, 16.79, 18.11]

What am I missing that it will not separate each column out or pull them in?

Bob
  • 1
  • 3
  • 1
    [`zip()`](https://docs.python.org/3.7/library/functions.html#zip) all three together and loop over the result. – Klaus D. Oct 20 '19 at 02:21
  • so the zip exc is what i need. did i not make them into formated strings? Also would i still use the zip to combine them together to print out the sentence – Bob Oct 20 '19 at 02:28

0 Answers0