I'd like to print an large integer without the "e+XX" at the end in Python.
For example, when I write:
result = 1;
i = 0;
while i < k:
result = result * (n - i) / (i + 1)
i += 1
I think the question you really want to ask is 'how can I print a number in Python without scientific notation?'
The answer is, your number right now is a float. Try
print(type(result)) and you will see it says
float. You could type cast it to an integer by doing
int(result), and it will show close to the full number,
30664510802988208128. It will be a bit off because of the memory size storage limitations of int vs float.
The better way to do this would be like:
result = 1 i = 0 while i < 18: result = result * (100 - i) // (i + 1) i += 1 print(result)
which will keep
result as an int type. It now should print 30664510802988208300