pythonExample100/JCP070.py

10 lines
250 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'''
题目写一个函数求一个字符串的长度在main函数中输入字符串并输出其长度。   
1.程序分析:
2.程序源代码
就这样吧
'''
if __name__ == '__main__':
s = raw_input('please input a string:\n')
print 'the string has %d characters.' % len(s)