#-*-coding:utf-8-*- ''' 統計用戶輸入的字符串中有幾個數字 ''' # numList = ['0','1','2','3','4','5','6','7','8','9'] s = input('請輸入字符串:') count = 0 for i in s: if i in numList: count +=1 print(count)
#-*-coding:utf-8-*- ''' 統計用戶輸入的字符串中有幾個數字 ''' # numList = ['0','1','2','3','4','5','6','7','8','9'] s = input('請輸入字符串:') count = 0 for i in s: if i in numList: count +=1 print(count)
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。