- 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.
推薦閱讀
- 大學(xué)計(jì)算機(jī)信息技術(shù)導(dǎo)論
- AutoCAD繪圖實(shí)用速查通典
- 面向STEM的mBlock智能機(jī)器人創(chuàng)新課程
- HBase Design Patterns
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- Visual Basic從初學(xué)到精通
- AI 3.0
- 觸控顯示技術(shù)
- 塊數(shù)據(jù)5.0:數(shù)據(jù)社會(huì)學(xué)的理論與方法
- JavaScript典型應(yīng)用與最佳實(shí)踐
- Windows安全指南
- 電動(dòng)汽車驅(qū)動(dòng)與控制技術(shù)
- Learning Cassandra for Administrators
- 大數(shù)據(jù)素質(zhì)讀本
- Generative Adversarial Networks Projects