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)
相关推荐
wdfk_prog39 分钟前
[Linux]学习笔记系列 -- bits
linux·笔记·学习
求梦82041 分钟前
JVM学习
jvm·学习
九成宫42 分钟前
计算机网络期末复习——第4章:网络层 Part One
网络·笔记·计算机网络·软件工程
星火开发设计43 分钟前
C++ multiset 全面解析与实战指南
开发语言·数据结构·c++·学习·set·知识
shuangrenlong1 小时前
音乐app笔记
笔记
am心1 小时前
学习笔记-菜品接口-菜品分页查询
笔记·学习
swan4161 小时前
SCAU期末笔记 - 计算机网络雨课堂习题整理
arm开发·笔记·计算机网络
丝斯20111 小时前
AI学习笔记整理(44)——大规模预训练模型数据处理管道Pipeline
人工智能·笔记·学习
自不量力的A同学1 小时前
Dragonfly v2.4.0 发布
笔记
知识分享小能手1 小时前
Oracle 19c入门学习教程,从入门到精通, —— 知识点详解(1)
数据库·学习·oracle