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)
相关推荐
一只路人甲2 小时前
使用AI快速学习
学习
传奇开心果编程3 小时前
【Rust入门练中学】第2课:变量、可变性与常量
开发语言·学习·rust
边境悍匪5 小时前
蜗牛学苑 Java 智能体学习 Day42|项目周开发技术汇总 1 思维导图复盘
java·开发语言·spring boot·学习·spring
Gyr05 小时前
浅刷了一遍51CTO软考题库客观题及其解析(4)
学习·软考·知识点·信息安全工程师
是隼人6 小时前
buuctf-pwn [NewStarCTF 2023 公开赛道]stack migration(64位栈迁移)题解(学习过程持续更新)
c语言·学习·安全·pwn入门·ctf入门
ι:6 小时前
单相桥式全控整流仿真从零复现教学
windows·学习·matlab·simulink
CAYA-6 小时前
模电笔记1.1 半导体基础与 PN 结
经验分享·笔记·学习方法
传奇开心果编程7 小时前
【Rust入门练中学】 第3课:数据类型
开发语言·学习·rust
humors2217 小时前
今年我正在看、看完和还没看的书单(不定期更新)
学习·阅读·读书·书单·书籍
泡泡鱼(敲代码中)7 小时前
MySQL 学习笔记:DCL、函数与约束 —— 安全、效率、完整性的三板斧
开发语言·笔记·sql·学习·mysql·gitee