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)
相关推荐
kdxiaojie16 分钟前
Linux 驱动研究 —— SDIO (1)
linux·运维·笔记·学习·sdio
3A Cloud1 小时前
Architecture Diagram Skill 详细介绍
人工智能·笔记·信息可视化
疯狂打码的少年2 小时前
【数据结构】栈:定义、顺序栈与链式栈
数据结构·笔记
我能坚持多久3 小时前
优选算法——专题一双指针(上):附四道例题详解
c++·学习·算法
zzm6283 小时前
WSDM 2018论文精读:基于多关系学习与路径约束的商品替代互补关系挖掘
人工智能·学习
IT古董4 小时前
【MES学习笔记系列】MES 术语表
笔记·学习
Anesthesia丶5 小时前
PromoxVE安装笔记
笔记·ubuntu·server·promox
疯狂打码的少年5 小时前
【数据结构】顺序表 vs 链表的对比与选择
数据结构·笔记·链表
Nontee6 小时前
首个开源 PR 从 0 到合并:Reasonix 修复全流程复盘
笔记·学习·github
云深处@15 小时前
【数据库】MySQL 入门
数据库·学习·mysql