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)
相关推荐
长安即是故里27 分钟前
Maxwell学习笔记
笔记·学习
★YUI★2 小时前
学习制作记录(选项UI以及存档系统)8.24
学习·游戏·ui·unity·c#
咸甜适中2 小时前
rust语言 (1.88) egui (0.32.1) 学习笔记(逐行注释)(十四)垂直滚动条
笔记·学习·rust·egui
努力敲代码的小盆友3 小时前
[自用笔记]上传本地项目至github
笔记·github
It_张4 小时前
Building Systems with the ChatGPT API 使用 ChatGPT API 搭建系统(第五章学习笔记及总结)
笔记·学习·chatgpt
The_Second_Coming5 小时前
Linux 学习笔记 - 集群管理篇
linux·笔记·学习
浪子不回头4157 小时前
Mirage-LLM编译成大Kernel
学习
red_redemption9 小时前
自由学习记录(87)
学习
使二颗心免于哀伤10 小时前
《设计模式之禅》笔记摘录 - 17.模板方法模式
笔记·设计模式·模板方法模式
咸甜适中10 小时前
rust语言 (1.88) egui (0.32.1) 学习笔记(逐行注释)(十五)网格布局
笔记·学习·rust·egui