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)
相关推荐
琳少_8 小时前
java程序开发笔记
java·开发语言·数据库·笔记
Z21-X11 小时前
云原生运维学习笔记:Kubernetes Volume 与 Secret 实验
运维·笔记·学习·云原生·kubernetes
一只大鸽子11 小时前
游戏开发笔记7-Godot RPG游戏基础-场景切换、全局脚本
笔记·游戏·godot
console.log('npc')15 小时前
Python 学习教程 · 第4课:数据结构
数据结构·python·学习
吃我一窝jio15 小时前
Docker+Jenkins+K8s全流程部署
java·开发语言·笔记·python
我超膨胀der.15 小时前
关于如何完整转移LABVIEW源码
笔记·labview
国科安芯16 小时前
FPGA上电偶发不启动:多轨电源时序、PGOOD与并联供电的FAE排查笔记——ASP4644S2B在星载智能处理板中的工程应用分析
笔记·单片机·嵌入式硬件·fpga开发·低轨卫星·抗辐射
星落梦生18 小时前
Docker学习(11)
学习·docker·容器
一条破秋裤1 天前
【1115】【多线程】【笔记】
前端·chrome·笔记