fork download
  1. msg = "hello 123 WORLD"
  2. #输出字符串的总长度,并输出其中小写字母的个数
  3. length = len(msg)
  4. print("字符串的总长度:",length)
  5.  
  6. low = sum(1 for ch in msg if ch.islower())
  7. print("小写字母的个数:",low)
Success #stdin #stdout 0.07s 14120KB
stdin
Standard input is empty
stdout
字符串的总长度: 15
小写字母的个数: 5