使用ljust方法将字符串左对齐并用星号填充至15个字符。
Use ljust to left-align the string and pad it with asterisks to 15 characters.
▼点击显示答案
ljust英 /ˈɛldʒʌst/|美 /ˈɛldʒʌst/
解释
ljust 是由 left(左)和 justify(对齐)组合而成的计算机术语,left 表示"左侧",justify 表示"对齐"。ljust 是 Python 字符串方法,表示"左对齐"。
在编程中,ljust 方法会将字符串内容靠左对齐,并在右侧用指定字符(这里是星号)填充,直到字符串达到指定长度(这里是15个字符)。
Use ljust to left-align the string and pad it with asterisks to 15 characters.
ljust 是由 left(左)和 justify(对齐)组合而成的计算机术语,left 表示"左侧",justify 表示"对齐"。ljust 是 Python 字符串方法,表示"左对齐"。 在编程中,ljust 方法会将字符串内容靠左对齐,并在右侧用指定字符(这里是星号)填充,直到字符串达到指定长度(这里是15个字符)。
在 App 中完整学习这张卡片
在 App 中学习