面试题答案
一键面试string = 'Hello'
formatted_string = ("%*s*" % ((10 - len(string) - 1) // 2, string)).center(10, '*')
print(formatted_string)
string = 'Hello'
formatted_string = ("%*s*" % ((10 - len(string) - 1) // 2, string)).center(10, '*')
print(formatted_string)