Python 練習實例60

Python 100例 Python 100例

題目:計算字串長度。  

程式分析:無。

實例(Python 2.0+)

#!/usr/bin/python # -*- coding: UTF-8 -*- sStr1 = 'strlen' print len(sStr1)

以上實例輸出結果為:

6

Python 100例 Python 100例