码迷,mamicode.com
首页 > 编程语言 > 详细

python 学习笔记

时间:2015-04-09 00:56:37      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

>>> help(print)
Help on built-in function print in module builtins:

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.

------------------------------------------------------------------------------------

>>> ‘hh‘
‘hh‘

>>> "hh"
‘hh‘

>>> "‘hh‘"
"‘hh‘"

>>> ‘"hh"‘
‘"hh"‘
>>> "\"hh\""
‘"hh"‘

>>> "\‘hh\‘"
"‘hh‘"


>>> print(‘1‘,‘2‘,‘3‘,sep=‘*‘)
1*2*3
>>> print(‘1‘,‘2‘,‘3‘,sep=‘*‘,end=‘!‘)
1*2*3!

==============================================

 

python 学习笔记

标签:

原文地址:http://www.cnblogs.com/hhdllhflower/p/4405042.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!