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)
相关推荐
Capricorn198833 分钟前
防编造架构实战:对比 Gemini Notebook 解析知芽 Notebook Skill 的工程实现
人工智能·笔记·elasticsearch·架构·知识图谱·论文笔记
Asum1ta1 小时前
K8s 学习环境搭建:Python 与 PyCharm 开发环境配置指南
python·学习·kubernetes
知识汲取者1 小时前
FastAPI 学习教程(写给想学 FastAPI 的 Java 工程师的)
python·学习·fastapi
Shell运维手记1 小时前
Linux mdadm 软 RAID + LVM 完整综合笔记
linux·运维·笔记·5g
疯狂打码的少年1 小时前
【数据库技术】SQL数据查询(SELECT基本语法)
数据库·笔记·sql·oracle
Made in Haven7121 小时前
HTML课程笔记补2
前端·笔记·html
一只小阿乐2 小时前
java 语法学习 1
java·开发语言·学习
dear_bi_MyOnly2 小时前
函数模块化:企业级项目高效之道
c++·后端·学习
QQ14220784492 小时前
知识库管理和工作学习系统--guada_ai
学习
夕除2 小时前
redis--010
笔记·分布式·学习