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)
相关推荐
想做小南娘,发现自己是女生喵9 小时前
第二周学习文档 Linux C 文件操作
linux·c语言·学习
乔旭伟9 小时前
Linux 服务器环境搭建实战笔记:最小化安装、Docker Compose 编排与上线检查全流程
linux·服务器·笔记
潜心一志9 小时前
图像预处理—— 图像的变换与校正(理论)
学习·计算机视觉
nmjkhome9 小时前
26 疲劳的几个重要概念(第51课)-solid works simulation
学习
深圳老胡9 小时前
RTX 与其他 RTOS 操作系统的差异及优缺点分析
笔记·stm32·单片机·代码规范
程序猿乐锅9 小时前
【从0-1学习Python | 第六篇】 Python 函数:定义、参数与返回值
开发语言·python·学习
燕落南枝9 小时前
HTML 学习:input 单选、复选与文件域详解
服务器·学习·html
优选资源分享20 小时前
PicGo v3.0.3 新版 | 开源免费图床工具
javascript·笔记·electron
星恒随风21 小时前
Linux线程概念详解:从分页存储、页表、MMU与TLB,深入理解线程和进程的区别与联系
linux·运维·笔记·学习·状态模式
qq_2842740521 小时前
数控机床编程基础与坐标系:编程六步流程、程序号/程序段/程序字格式,与右手定则下车床铣床XYZ轴判定(含考点)
笔记·学习·自动化·制造