python循环求值
python循环输出1+11+111+1111+11111=12345
def test(n): sum=0 for i in range(1,n+1): while i>0: sum+=10**(i-1) i-=1 return sum print(test(5))
python循环输出1+11+111+1111+11111=12345
def test(n): sum=0 for i in range(1,n+1): while i>0: sum+=10**(i-1) i-=1 return sum print(test(5))