【发布时间】:2013-08-12 01:55:03
【问题描述】:
这个程序的输出是一个表格,但是有点乱。如何对齐不同的列?谢谢
代码:
import math
for a in range(1, 10):
x = 3.0
while True:
y = (x + a/x) / 2
if y == x:
break
x = y
sq = math.sqrt(a)
print float(a), sq, x, abs(sq - x)
【问题讨论】:
标签: python python-2.7