SEP和END参数()语句

发布于 2025-02-09 03:01:07 字数 442 浏览 2 评论 0原文

我目前正在使用Python 3.9.6版本,并且在使用“ SEP =”的print()语句作为参数时,我会收到语法错误。

我的“ SEP”参数的代码是: 打印(“ John”,“ Sam”,“ Michael”,Sep =“ - ”)

我的“ end”参数的代码是: 。

我不明白我的代码问题是什么 请帮助

请找到两个代码的附件片段:在此处输入image Description

在此处输入图像描述

预先感谢!

I am currently using Python 3.9.6 version and while using the print() statement with "sep=" as an argument, i am getting the syntax error.

My code for "Sep" Argument is:
print("John","Sam","Michael",sep="-")

My code for "End" Argument is:
print("John","Sam","Michael",end="-")

I don't understand what's the problem with my code. Please help

Please find the attached snippet of both the codes:enter image description here

enter image description here

Thanks in advance!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

墨洒年华 2025-02-16 03:01:07

尝试使用结束

例如:打印(“ John”,“ Sam”,“ Michael”,End =“ - ”)

Try using end.

Ex: print("John","Sam","Michael",end="-")

奢望 2025-02-16 03:01:07

尝试以下操作:

print("John","Sam","Michael",sep,"=","-")

try this :

print("John","Sam","Michael",sep,"=","-")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文