InternLM学习笔记

入门岛

1. Linux基础知识





2. Python 基础知识

python 复制代码
from collections import Counter


text = """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""


def wordcount(text: str):
    text = text.lower().replace('.', '').replace(',', '').replace('\n', ' ')
    words = [word[:-2] if word.endswith("'s") else word for word in text.split(' ') if word]
    return dict(Counter(words))


if __name__ == '__main__':
    res = wordcount(text)
    print(res)
相关推荐
Elias不吃糖7 分钟前
第四天学习总结:C++ 文件系统 × Linux 自动化 × Makefile 工程化
linux·c++·学习
CodeCraft Studio18 分钟前
PPT处理控件Aspose.Slides教程:使用Java将PowerPoint笔记导出为PDF
java·笔记·pdf·powerpoint·aspose·ppt转pdf·java将ppt导出pdf
雍凉明月夜29 分钟前
人工智能学习中深度学习之python基础之 类
python·学习
王同学要变强42 分钟前
【深入学习Vue丨第二篇】构建动态Web应用的基础
前端·vue.js·学习
好奇龙猫1 小时前
日语学习-日语知识点小记-构建基础-JLPT-N3阶段-二阶段(14):文法和单词-第三课
学习
仰望—星空1 小时前
MiniEngine学习笔记 : DescriptorHeap
windows·笔记·学习
武昌库里写JAVA1 小时前
element-ui 2.x 及 vxe-table 2.x 使用 css 定制主题
java·vue.js·spring boot·sql·学习
YangYang9YangYan2 小时前
高职大数据技术专业学习与发展指南
大数据·人工智能·学习·数据分析
go_bai2 小时前
Linux--进程池
linux·c++·经验分享·笔记·学习方法
Mr.Jessy2 小时前
Web APIs 学习第四天:DOM事件进阶
开发语言·前端·javascript·学习·ecmascript