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)
相关推荐
gc_22994 小时前
学习C#调用OpenXml操作word文档的基本用法(7:Style类分析-5)
学习·word·openxml
AA陈超4 小时前
ASC学习笔记0014:手动添加一个新的属性集
c++·笔记·学习·ue5
Chunyyyen4 小时前
【第二十二周】自然语言处理的学习笔记06
笔记·学习·自然语言处理
hhcccchh5 小时前
学习vue第三天 Vue 前端项目结构的说明
前端·vue.js·学习
谅望者7 小时前
数据分析笔记06:假设检验
笔记·数据挖掘·数据分析
摇滚侠8 小时前
Vue 项目实战《尚医通》,获取当前账户就诊人信息并展示出来,笔记42
前端·javascript·vue.js·笔记·html5
重启编程之路8 小时前
python 基础学习socket -TCP编程
网络·python·学习·tcp/ip
石像鬼₧魂石8 小时前
Kali Linux 中对某(靶机)监控设备进行漏洞验证的完整流程(卧室监控学习)
linux·运维·学习
d111111111d9 小时前
STM32通信协议学习--I2C通信(了解)
笔记·stm32·单片机·嵌入式硬件·学习