#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 問題:給出一個字符串,分別輸出該字符串中小寫字母,大寫字母,數字,以及其他字符串的個數
chuan = "aasdhauADSGFTHFTdbhi1224324漢字"
len_lower = 0
len_upper = 0
len_digit = 0
for i in chuan:
if i.islower():
len_lower += 1
if i.isupper():
len_upper += 1
if i.isdigit():
len_digit += 1
len_other = len(chuan) - len_lower - len_upper - len_digit
print len_lower
print len_upper
print len_digit
print len_other
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
