官术网_书友最值得收藏!

Strings

A value with a string data type is simply a collection of characters. You've already seen a string data type in use from the hello world program that you created earlier, namely, Hello World!. String values are created in Python by writing the contents of a string inside quotation marks:

>> "your string here"

Two or more strings can be merged together or concatenated using the + operator:

>> "string 1 " + "string 2"
Python does not distinguish between single quotes and double quotes; however, the opening quotes must be the same as the closing quotes ( "This will not work').

I will cover string operations in detail in Chapter 5, Manipulating Text Data - An Introduction to Regular Expressions.

主站蜘蛛池模板: 绍兴市| 元谋县| 微博| 扶风县| 华池县| 堆龙德庆县| 南宫市| 甘孜| 同心县| 钟山县| 宜丰县| 巴彦县| 玛曲县| 梧州市| 开化县| 民勤县| 栖霞市| 武川县| 册亨县| 婺源县| 视频| 梅河口市| 潮州市| 洛南县| 海安县| 武汉市| 昭通市| 青河县| 三河市| 通化市| 襄城县| 宜川县| 呼和浩特市| 英德市| 荥经县| 新营市| 宁乡县| 潮州市| 肥城市| 信阳市| 湛江市|