String Concatenation

来源:互联网 发布:游戏程序员工资 编辑:程序博客网 时间:2024/06/06 03:28
String Concatenation

You know about strings, and you know about arithmetic operators. But did you know some arithmetic operators work on strings?

If you use the + operator between two strings, it concatenates them (glues them together).

print "Monty " + "Python"

will print out "Monty Python"!

Give it a go in the editor. print the concatenated strings "Spam ""and ""eggs" on line 3 to print the string"Spam and eggs" to the console.

原创粉丝点击