滚动到相反的方向

时间:2013-12-09 19:40:39

标签: python python-3.x

这是我的代码:

n=int(input())

from math import *

while n!=0:
     print (n,"\t",log10(n))
     n=n-1

它的输出是:

10   1.0
9    0.9542425094393249
8    0.9030899869919435
7    0.8450980400142568  
6    0.7781512503836436
5    0.6989700043360189 
4    0.6020599913279624
3    0.47712125471966244
2    0.3010299956639812
1    0.0

我希望它是:

1    0.0
2    0.3010299956639812
3    0.47712125471966244
4    0.6020599913279624
5    0.6989700043360189
.
.
.
9    0.9542425094393249
10   1.0

1 个答案:

答案 0 :(得分:2)

n=int(input())

from math import*

for i in range(1,n+1):

     print (i,"\t",log10(i))