鱼C论坛

 找回密码
 立即注册
查看: 2624|回复: 3

Python第三讲有些课后题答案看不懂,求解

[复制链接]
发表于 2013-11-26 10:38:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
end = ""和 end = " "的区别是什么?加不加空格都不会产生换行啊。
为什么在 print("猜一下是哪个数字:")输入数字后也能进入循环,
为什么不用 temp = input();guess = int(temp),如果能用怎么用
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2013-11-28 09:50:41 | 显示全部楼层
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) Print objects to the stream file, separated by sep and followed by end. sep, end and file, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like str() does and written to the stream, separated by sep and followed by end. Both sep and end must be strings; they can also be None, which means to use the default values. If no objects are given, print() will just write end.
The file argument must be an object with a write(string) method; if it is not present or None, sys.stdout will be used. Whether output is buffered is usually determined by file, but if the flush keyword argument is true, the stream is forcibly flushed.
Changed in version 3.3: Added the flush keyword argument.

end = ' '表示强调以空格结束,默认参数是end = '\n'。

第三讲有这道课后题吗?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2015-5-9 10:27:28 | 显示全部楼层
回过头再看就懂了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2015-5-18 15:46:52 | 显示全部楼层
学习学习:lol:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-10 08:28

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表