日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

组合数据类型练习、英语词频统计

發布時間:2024/1/17 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 组合数据类型练习、英语词频统计 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
  • 字典實例:建立學生學號成績字典,做增刪改查遍歷操作。 di={} di["001"]=76 di["002"]=87 di["003"]=79 di["004"]=98 di["005"]=72 print(di) di["006"]=95 print(di) del(di['005']) print(di) for i in di:print(i,di[i])

    ?

  • 列表,元組,字典,集合的遍歷。
    總結列表,元組,字典,集合的聯系與區別。 w=list('154896') e=tuple('564255') t=dict(zip(w,e)) u=set([5,3,8,8,6,1]) for i in w:print(i) for i in e:print(i) for i in t:print(i,t[i]) for i in u:print(i)
    ?列表元組字典集合
    可否讀寫可讀寫只讀可讀寫可讀寫
    可否重復
    存儲方式鍵值對(鍵不可重復)鍵(不可重復)
    是否有序
    添加append?d[key]=valueadd
    ?????
    ?

    ?

  • 英文詞頻統計實例
  • 待分析字符串
  • 分解提取單詞
  • 大小寫 txt.lower()
  • 分隔符'.,:;?!-_’
  • 單詞列表
  • 單詞計數字典

    lp='''You hid your skeletons, when I had shown you mine
    you woke the devil that I thought you left behind
    I saw the evidence the crimson soaking through
    ten thousand promises, ten thousand ways to lose...

    And you held It all
    but you were careless to let it fall
    you held it all
    and I was by your side
    Powerless

    I watched you fall apart
    and chased you to the end
    I'm left an empty mess, that words can not defend
    you'll never know what I became
    because of you
    ten thousand promises, ten thousand ways to lose...

    And you held It all
    but you were careless to let it fall'''
    less=lp.lower()
    print(less)
    for i in ",...'":
    lp=less.replace(i," ")
    print(lp)
    power=lp.split()
    print(power)

    dic={}

    for i in power:
    dic[i]= power.count(i)
    lp=list(dic.items())

    print('單詞計數字典:',lp)

    )

    ?

    ?

    ?

  • 轉載于:https://www.cnblogs.com/yin-yeah/p/7596004.html

    總結

    以上是生活随笔為你收集整理的组合数据类型练习、英语词频统计的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。