def main():
#code here
a = 455
b = -123
c = 987654
print("{:<5}".format(a), "{:>5}".format(a))
print("{:<5}".format(b), "{:>5}".format(b))
print("{:<5}".format(c), "{:>5}".format(c))
if __name__ == '__main__':
main();
python输出455、-123、987654,宽度为5,分别左对齐和右对齐
最新推荐文章于 2024-08-20 15:28:58 发布