Budget App ! trouble with create_spend_chart

Tell us what’s happening:
I have been trying to solve “create_spend_chart” for weeks now. The code works perfectly and is able to create the chart as described in the read.me file. But, somehow there is an assertion error during testing. Please help !! I want to complete all the projects and get certified.

Your code so far

        def create_spend_chart(list_name):
  withdrawls = []
  categories_name = []
  percents = []
  for name in list_name:
    temp = 0
    categories_name.append(name.name.title())
    for items in name.ledger:
      item = list(items.values())
      if item[0] >= 0:
        continue
      else:
        temp = temp + (-(item[0]))
    withdrawls.append(temp)
#   print(withdrawls)
  list_num = list(range(0,101, 10))[::-1]

  output = "Percentage spent by category\n"

  #calculating percents 
  total = sum(withdrawls)
  for x in range(len(withdrawls)):
    per = withdrawls[x] /  total
    per = int(round(per * 100, -1))
    percents.append(per)
#   print(percents)

  for num in list_num:
    print_str = str(num).rjust(3) + "|"
    for per in percents: 
      if per < num:
        print_str += "   "
      else:
        print_str += " o "
    output += print_str + "\n"      
  dash_string = " " * 4 + "-" * (3 * len(withdrawls) + 1)
  output = output + dash_string

  maxlength = len(max(categories_name, key = len))
  vertical_output = "" 
  for i in range(maxlength):
    vertical_name =  4 * " "     
    for name in categories_name:
      try:
        vertical_name += " " + str(name)[i] + " "
      except IndexError: 
        vertical_name += "   "
    vertical_output += vertical_name + "\n"
  output = output + "\n" + vertical_output
  return output

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Budget App

Link to the challenge:

https://repl.it/join/ystdldul-th_dipendra

this is the link to my complete code…

Looking at the error from the tests seems that there’s one space not enough in each line. Possibly there are some other formatting issues, but this one is first encountered by the test.

AssertionError: 
'Perc[34 chars]     \n 90|         \n 80|         \n 70|    o[318 chars]t \n' != 
'Perc[34 chars]      \n 90|          \n 80|          \n 70|  [340 chars] t  '

@sanity thank you for your help, I will try your recommendation.