letter = 0
space = 0
digit = 0
other = 0
for c in s:
if c.isalpha():
letter += 1
elif c.isspace():
space += 1
elif c.isdigit():
digit += 1
else:
other += 1
s = input("input a string:")
letter = 0
space = 0
digit = 0
other = 0
for c in s:
if c.isalpha():
letter+=1
elif c.isspace():
space+=1
elif c.isdigit():
digit+=1
else:
other+=1
print('There are %d letters,%d spaces,%d digits \
and %d other characters in your string.' \
%(letter,space,digit,other))
沒錯啊
uj5u.com熱心網友回復:
我又試了一下 可以跑出來了 謝謝啦
uj5u.com熱心網友回復:
import string
s = input("input a string:")
letter = 0
space = 0
digit = 0
other = 0
for c in s:
if c.isalpha():
letter += 1
elif c.isspace():
space += 1
elif c.isdigit():
digit += 1
else:
other += 1
s = input("input a string:")
letter = 0
space = 0
digit = 0
other = 0
for c in s:
if c.isalpha():
letter+=1
elif c.isspace():
space+=1
elif c.isdigit():
digit+=1
else:
other+=1
print('There are %d letters,%d spaces,%d digits \
and %d other characters in your string.' \
%(letter,space,digit,other))
我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......