Python参数中的空格

Dem*_*nic 1 python

几天前才开始学习Python.

例如print "Hello, World",当我输入参数时,我是否应该(或不应该)print在字符串之间放置空格?或者,如果我想变name = raw_input ("name?"),我应该有之间的spave name,=,raw_input等?它似乎没有好的工作,但我不想开始养成将来会咬我的坏习惯.

Ken*_*nzo 5

Python确实有自己的风格指南(PEP 8),绝对值得您花时间阅读它.就你所说的而言:

    More than one space around an assignment (or other) operator to align it with another.

    x = 1
    y = 2
    long_variable = 3
Run Code Online (Sandbox Code Playgroud)

更多信息:http://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements