玉滨的博客

导航

2018年10月8日 #

组合数据类型,英文词频统计

摘要: sunstr = '''Girl I can't notice but to, notice you, noticing me From across the room I can see it and can't Stop myself from looking and noticing you, noticing me Watch out I've seen her type before ... 阅读全文

posted @ 2018-10-08 11:37 玉滨的博客 阅读(213) 评论(0) 推荐(0)

Python中元组、列表、字典的遍历和相互转化

摘要: 一、元组,列表,字典的遍历 1.1 元组的遍历 元组的遍历借助 range() 函数,基本思想是通过元组的长度使用for循环进行遍历,代码如下: fruits=("apple","banana","orange") for i in range(len(fruits)): print(fruits[ 阅读全文

posted @ 2018-10-08 11:35 玉滨的博客 阅读(1142) 评论(0) 推荐(0)

python 字符串,列表,元组,字典相互转换

摘要: 1、字典 dict = {'name': 'Zara', 'age': 7, 'class': 'First'} 字典转为字符串,返回:<type 'str'> {'age': 7, 'name': 'Zara', 'class': 'First'} print type(str(dict)), s 阅读全文

posted @ 2018-10-08 11:26 玉滨的博客 阅读(313) 评论(0) 推荐(0)