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)
相关推荐
日记成书14 分钟前
详细介绍嵌入式硬件设计
嵌入式硬件·深度学习·学习
SRA.23 分钟前
STM32——HAL库开发笔记23(定时器4—输入捕获)(参考来源:b站铁头山羊)
笔记·stm32·嵌入式硬件
Dawndddddd26 分钟前
网络安全之攻防笔记--通用安全漏洞SQL注入&sqlmap&Oracle&mongodb&DB2
笔记·sql·安全·web安全
技术小齐31 分钟前
网络运维学习笔记 022 HCIA-Datacom新增知识点03园区网典型组网架构及案例实战
运维·网络·学习
Dongwoo Jeong40 分钟前
类型系统下的语言分类与类型系统基础
java·笔记·python·lisp·fortran·type
Cacciatore->2 小时前
笔记 大学物理B下册
笔记
hxung2 小时前
MySQL面试学习
学习·mysql·面试
weixin_502539853 小时前
rust学习笔记5-所有权机制
笔记·学习·rust
PyAIGCMaster3 小时前
50周学习go语言:第四周 函数与错误处理深度解析
开发语言·学习·golang
~kiss~3 小时前
Rust学习~tokio简介
开发语言·学习·rust