首页 > 编程语言 > 详细

python print 输出赋值到变量

时间:2020-11-25 22:49:36      阅读:242      评论:0      收藏:0      [点我收藏+]
In [52]: import io
In [53]: row = (ACME, 50, 91.5)
In [54]: ,.join(row)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-54-b1add756d97c> in <module>
----> 1 ,.join(row)

TypeError: sequence item 1: expected str instance, int found
In [55]: r = io.StringIO()
In [56]: print(*row,sep=,,file=r)
In [57]: r.getvalue()
Out[57]: ACME,50,91.5\n
In [58]: row = r.getvalue()
In [59]: row
Out[59]: ACME,50,91.5\n

 

python print 输出赋值到变量

原文:https://www.cnblogs.com/morse/p/14037338.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!