import pprint
messages = 'The old sayings is where there is a will ,there is a way.'
count = {}
for characte in messages:
count.setdefault(characte,0)
count[characte]=count[characte] + 1
pprint.pprint(count)
def bx(spa):
print("'",end='')
for i in range(len(spa)-1):
print(spa[i],", ",end="")
print(spa[-1],"'",end='')
span=['apples','banana','tofu','cats','dogs','pigs']
bx(span)
python编程快速上手作业4
最新推荐文章于 2023-03-30 23:29:04 发布