黄色电影一区二区,韩国少妇自慰A片免费看,精品人妻少妇一级毛片免费蜜桃AV按摩师 ,超碰 香蕉

Python 練習(xí)實例70

python 練習(xí)實例70

python 編程100例python 編程100例

題目:寫一個函數(shù),求一個字符串的長度,在main函數(shù)中輸入字符串,并輸出其長度。

程序分析:無。

程序源代碼:

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

if __name__ == '__main__':
    s = raw_input('please input a string:\n')
    print 'the string has %d characters.' % len(s)

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

please input a string:
abc
the string has 3 characters.

python 編程100例python 編程100例

下一節(jié):python 練習(xí)實例71

python 編程100例

相關(guān)文章