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

  • Practical Data Wrangling
  • Allan Visochek
  • 128字
  • 2021-07-02 15:16:08

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.

主站蜘蛛池模板: 河间市| 乐亭县| 乳山市| 林甸县| 湄潭县| 金沙县| 江城| 仙游县| 西林县| 临西县| 恩施市| 剑川县| 繁峙县| 凌云县| 城口县| 永德县| 甘泉县| 融水| 都昌县| 合山市| 大新县| 布拖县| 奉节县| 静安区| 沈阳市| 湟中县| 罗平县| 义马市| 阜新市| 肥乡县| 蕉岭县| 龙井市| 库车县| 永昌县| 乌兰浩特市| 额济纳旗| 马龙县| 丰镇市| 江陵县| 互助| 开平市|