Monday, 19 October 2015

get used to PROGRAMMING: Fixed point combinator in Python



Consider we need to print 

1
22
333
4444
55555
......

The best solution is using Fixed point combinator

for i in range(1,input()+1):
    print (((pow(10,i))-1)/(9))*i



No comments:

Post a Comment