1. 程式人生 > >Python入門-字符串常用方法

Python入門-字符串常用方法

div 簡單 world 入門 span pre hello 方法 pytho

Python 字符串

字符串是 Python 中最常用的數據類型。我們可以使用引號(‘或")來創建字符串。

創建字符串很簡單,只要為變量分配一個值即可。

var1 = Hello World!
var2 = "Python Runoob"

Python入門-字符串常用方法