[英]How to print all digits of a large number in python?
So, I have a very large number that I'm working out in python, but when I try to print it I get something like this: 因此,我有大量的代码正在使用python进行计算,但是当我尝试打印时,会得到如下所示的信息:
3.101541146879488e+80
How do I print all the digits of my lovely number? 如何打印我的可爱号码的所有数字?
both int
and long
work for this 为此既需要
int
又需要long
工作
>>> a
3.101541146879488e+80
>>> int(a)
310154114687948792274813492416458874069290879741385354066259033875756607541870592L
>>> long(a)
310154114687948792274813492416458874069290879741385354066259033875756607541870592L
>>> print (int(a))
310154114687948792274813492416458874069290879741385354066259033875756607541870592
>>> print (long(a))
310154114687948792274813492416458874069290879741385354066259033875756607541870592
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.