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)
相关推荐
叩码以求索7 小时前
三维建模:SolidWorks 2025保姆级下载与安装教程指南
学习·数学建模
龙仔7258 小时前
人大金仓KingbaseES V8 手动单库备份&恢复操作笔记
数据库·笔记·oracle·人大金仓
zhangrelay9 小时前
消费电子原装锂电池服役8–20年且健康度>40%公开实测案例完整调研分析报告
笔记·学习
疯狂打码的少年9 小时前
【软件工程】软件测试:黑盒测试(等价类/边界值/因果图)
笔记·软件工程
tyqtyq2210 小时前
HarmonyOS AI 应用开发实战:简历项目经历改写系统
人工智能·学习·华为·生活·harmonyos
圣光SG10 小时前
Java Web入门基础知识笔记
java·前端·笔记
bush413 小时前
正点原子imx6ull-uboot,奇怪的问题
linux·学习
念雨思13 小时前
HarmonyOS AI 应用开发实战:短视频选题灵感 —— AI 驱动的内容创作引擎
人工智能·学习·华为·harmonyos·鸿蒙
蜡笔小电芯14 小时前
【电路设计】TVS 瞬态抑制二极管选型与应用笔记
笔记
2601_9593832414 小时前
休学干预的“信任难题”,坤和静界·春藤计划怎么尝试破局
学习