Python 練習(xí)實例60

Python 100例 Python 100例

題目:計算字符串長度。  

程序分析:無。

程序源代碼:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

sStr1 = 'strlen'
print len(sStr1)

以上實例輸出結(jié)果為:

6

Python 100例 Python 100例