Did you like how we did? Rate your experience!

4.5

satisfied

46 votes

How do I find the last non-zero number in factorial 201?

Here is a Python 3 solution: print('How do I find the last non-zero number in factorial 201?') prod = 1 for k in range(1,202): prod *= k sp = str(prod) lp = len(sp) while(True): if sp[lp-1] != '0': print('The last non-zero digit of 201! =',sp,'is',sp[lp-1]) break lp -=1 The output: How do I find the last non-zero number in factorial 201? The last non-zero digit of 201! = 158520231340322891214025006000369197521322331515121825922243249182116249442644071926981161086408909404739619639922847404881786200838770058117447251615518816153806034311423426764716794777728411569911784512291060691664690376713087265508782372723922354551304572738521493300705432412738235136532691872618031963366780714364483372318720000000000000000000000000000000000000000000000000 is 2 Good luck! >>>

100%
Loading, please wait...