使用spyder
#print函数和input函数
输入print()会出现print ()的用法,print(value, . ,sep=’ ‘,end=’\n’,file=sys.stdout,flush=False)。在python2中无需将要打印的内容放在括号内,但有的情况print后需要接“()”,这与python3中的含义不同。
其中value是要打印的值,sep是指间隔符,end是指最后一个值后追加的字符串默认为换行,flush这个参数具体的作用不清楚。``
message="One of Python's strengths is its diverse community."
message
print(message,end='\n',flush=False)
print(message,end='\n',flush=True)
print(message)
结果如下
print(message,end='\n',flush=False)
One of Python's strengths is its diverse community.
message
Out[36]: "One of Python's strengths is its diverse community."
print(message,end='\n',flush=True)
One of Python's strengths is its diverse community.
print(message)
One of Python's strengths is its diverse community.
input函数如果不加