立即学习:https://edu.csdn.net/course/play/26755/340143?utm_source=blogtoedu
字符串居中:center 和format 方法
1、print('<' + 'hello'center(30) + '>')
print('<' + 'hello'center(30,'#') + '>')
2、print('<{:^30}>'.format('hello')
print('<{:#^30}>'.format('hello')
立即学习:https://edu.csdn.net/course/play/26755/340143?utm_source=blogtoedu
字符串居中:center 和format 方法
1、print('<' + 'hello'center(30) + '>')
print('<' + 'hello'center(30,'#') + '>')
2、print('<{:^30}>'.format('hello')
print('<{:#^30}>'.format('hello')