Python Practice Example 60
Question:Calculate the length of a string.
Program analysis:None.
Example (Python 2.0+)
#!/usr/bin/python
# -*- coding: UTF-8 -*-
sStr1 = 'strlen'
print len(sStr1)
The output of the above example is:
6Other extensions
Question:Calculate the length of a string.
Program analysis:None.
The output of the above example is:
6Other extensions
Python 100 Examples