python功能 用python代碼輸入一行字符?
用python代碼輸入一行字符?Input a line of characters=Input(“please Input any data:”)位數(shù)=len(list(I for I in Inp
用python代碼輸入一行字符?
Input a line of characters=Input(“please Input any data:”)位數(shù)=len(list(I for I in Input a line of characters if I.isdigit()==1))中英文字母數(shù)=len(list(I for I in Input a line of characters if I.isalpha()==1))空格數(shù)=len(list(I for I in Input a line of characters ifi、 isdigit()==1))=“”)other number=len(輸入一行字符)-number of numbers-number of Chinese and English letters-number of spaces print(“{0}包含{1}個數(shù)字,{2}個中英文字母,{3}number of spaces,{4}other”。格式(輸入一行字符、數(shù)字、中英文字母數(shù)、空格數(shù)、其他數(shù)字)