您现在的位置是:主页 > news > 大良网站建设基本流程/kol营销模式
大良网站建设基本流程/kol营销模式
admin2025/5/3 8:08:26【news】
简介大良网站建设基本流程,kol营销模式,网站可以做的线下活动,增城专业建站公司字符串对齐 本文地址: http://blog.csdn.net/caroline_wendy/article/details/20463231 Python中, 字符串对齐, 使用ljust(), 左对齐;rjust(), 右对齐; center(), 中间对齐; 也可以修改第三个参数, 修改填充数据, 默认使用空格; 代码如下: # -*- coding: utf-8 -*- # #File: T…
大良网站建设基本流程,kol营销模式,网站可以做的线下活动,增城专业建站公司字符串对齐 本文地址: http://blog.csdn.net/caroline_wendy/article/details/20463231 Python中, 字符串对齐, 使用ljust(), 左对齐;rjust(), 右对齐; center(), 中间对齐; 也可以修改第三个参数, 修改填充数据, 默认使用空格; 代码如下: # -*- coding: utf-8 -*- # #File: T…
字符串对齐
本文地址: http://blog.csdn.net/caroline_wendy/article/details/20463231
Python中, 字符串对齐, 使用ljust(), 左对齐;rjust(), 右对齐; center(), 中间对齐;
也可以修改第三个参数, 修改填充数据, 默认使用空格;
代码如下:
# -*- coding: utf-8 -*- #==================== #File: TextExercise.py #Author: Wendy #Date: 2014-03-04 #==================== #eclipse pydev, python2.7 print('|' + 'hej'.ljust(20) + '|' + 'hej'.rjust(20) + '|' + 'hej'.center(20) + '|') print('hej'.center(20, '+')) #一共有20个字符, 中间使用hej, 其他用+填充
输出:
|hej | hej| hej | ++++++++hej+++++++++
转载于:https://blog.51cto.com/spikeking/1387928