zoukankan      html  css  js  c++  java
  • 英文词频统计预备,组合数据类型练习

    1.实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,,分隔出一个一个的单词。

    英文歌曲:

    Big big world-Emilia
    I'm a big big girl !
    In a big big world !
    It's not a big big thing if you leave me.
    But I do do feel.
    That I too too will miss you much.
    Miss you much !
    I can see the first leaf falling.
    It's so very cold outside.
    Like the way I'm feeling inside.
    I'm a big big girl !
    In a big big world !
    It's not a big big thing if you leave me.
    But I do do feel.。
    That I too too will miss you much.
    Miss you much !
    Outside it's now raining.
    And tears are falling from my eyes.
    Why did it have to happen ?
    Why did it all have to end ?
    I'm a big big girl !
    In a big big world !

    ,.?!等替换为空格:

    将所有大写转换为小写:

    统计某几个单词出现的次数:

    分隔出一个一个的单词:

    2.列表实例:由字符串创建一个作业评分列表,做增删改查询统计遍历操作。例如,查询第一个3分的下标,统计1分的同学有多少个,3分的同学有多少个等。

    3.简要描述列表与元组的异同

    list是处理一组有序项目的数据结构,即你可以在一个列表中存储一个序列的项目。列表中的项目。列表中的项目应该包括在方括号中,这样python就知道你是在指明一个列表。元组通常用在使语句或用户定义的函数能够安全的采用一组值的时候,即被使用的元组的值不会改变。元组可以嵌套。

  • 相关阅读:
    Datatable导出到Excel
    C# 连接EXCEL和ACCESS字符串2003及2007版字符串说明
    C#-读取写入Excel
    简易的命令行入门教程:
    日志记录
    python环境管理器的选择
    go语言的模块处理
    pip 使用国内源 安装类库
    go 实现单链表并使用一种常规实现翻转,一种使用递归实现翻转
    数据库产品选型
  • 原文地址:https://www.cnblogs.com/chenhuafei/p/7562070.html
Copyright © 2011-2022 走看看