Write a function that takes a string of characters as its first parameter, and the width of the terminal in characters as its second parameter. Your function should return a new string that consists of the original string and the correct number of leading spaces so that the original string will appear centered within the provided width when it is printed. Do not add any characters to the end of the string.
def console_center(string, width): spaces = " " * int((width / 2) - (len(string)/2)) return spaces + string def main(): print(console_center("Hi there", 80)) if __name__ == '__main__': main()