实例(Python 2.0+)#!/usr/bin/python # -*- coding: UTF-8 -*- sStr1 = 'strlen' print len(sStr1)以上实例输出结果为:6