组合数据类型综合练习:英文词频统计

分别定义字符串

>>> s='homework'
>>> for i in s:
    print(i)

列表

>>> classmates=['Candy','Michael','Bob','Amy','[1,2,3]']
>>> for i in classmates:
    print(i)

 

元组

>>> tup=tuple('Candy')
>>> for i in tup:
    print(i)

 

字典

>>> names=['Candy','Michael','Amy']
>>> scores = [90, 89, 95]
>>> d = dict(zip(names,scores))
>>> for n,s in d.items():
    print(n,s)

 

集合

>>> st = set([9,7,'C','a',5,'n'])
>>> for i in st:
    print(i)

 

转载于:https://www.cnblogs.com/candyxue/p/8626806.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值