首页 > 代码库 > python练习-raw_input 和逗号

python练习-raw_input 和逗号

print "enter your name",
somename=raw_input()
print somename

 

结果如下 print “enter your name” 后有逗号 “,” 输入的内容会在同一行显示

Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
enter your name
hunk
hunk
>>> ================================ RESTART ================================
>>>
enter your name hello
hello
>>>

python练习-raw_input 和逗号