如何在 ',' 之后添加不带空格的新行在 Python 中的 print() 中
有两个数据并打印它们的长度。 代码:
print(len(author),'\n',len(authorUnique))
和输出:
5439
4443
我想获得:
5439
4443
我该怎么做才能获得我想要的东西?
There is two data and printing the length of them.
Code:
print(len(author),'\n',len(authorUnique))
and output:
5439
4443
I would like to get:
5439
4443
What can I do to get what I want?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要一次打印!将其分为两个单独的
打印
语句要简单得多,这也可以解决您的问题:如果您 do 只想使用一个打印语句,则需要指定右分离器令牌,这样:
Don't print them at once! It's much simpler to split this up into two separate
print
statements, which also solves your problem:If you do only want to use one print statement, however, you need to specify the right separator token, like this: