热线电话:13121318867

登录
2019-04-02 阅读量: 619
python的输入输出

输入与输出

python中输入与输出函数为:print、input

help()

帮助的使用:help()

help(print)

print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space. 插入字符
end: string appended after the last value, default a newline. 换行标志
flush: whether to forcibly flush the stream.
#例子
a = 1
b = 2
c = 3
print(a,b,c)
print(a,b,c,sep = '--+--' )#在AB中插入--+--
print(a,b,c,end = '这是一个不换行的结束符号!')#表示该输出不换行
#结果为:
1 2 3
1--+--2--+--3
1 2 3这是一个不换行的结束符号!

注意:

编写时数字不能写在最前面,但是可以写在后面 a1可以1a不可以。

编写要求:标点符号必须为英文字符,引号内可以键入中文字符。

不能将变量名设置为常用的英文单词。

python中严格区分大小写,严格要求缩进的格式。

input的输入为字符串,若要其他类型需要类型转化。

辅助工具可以使用notepad++,sublime text 3。

0.0000
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子