所以我目前正在努力学习python.在其中一个练习中,我们打印带有变量的字符串文字.我注意到,与其他语言不同,python会自动在字符串文字和变量之间添加空格.我只是好奇它是如何做到的.以下是我的意思的一个例子.
example.py:
total_SO_questions_asked = 1
print "I have asked", total_SO_questions_asked, "question to SO thus far."
Run Code Online (Sandbox Code Playgroud)
终奌站:
$ python example.py
I have asked 1 question to SO thus far.
Run Code Online (Sandbox Code Playgroud)
这很愚蠢而且不是很重要,但我很好奇,我希望这可以启发我!