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)
相关推荐
weixin_466068111 小时前
《十分钟冥想》精读笔记(上):每天10分钟,给大脑做一次“系统减负”
笔记
凯尔萨厮2 小时前
Java学习笔记十(注解)
java·笔记·学习
JoannaJuanCV2 小时前
VLM学习-SFT(监督微调)
深度学习·学习·机器学习·大模型·视觉大模型·vlm·视觉编码器
程序员大雄学编程3 小时前
微积分43. 无穷积分入门:从概念到Python实战可视化
开发语言·python·学习·微积分
一条破秋裤3 小时前
STM32 学习笔记:GPIO 输出实验——LED 闪烁、流水灯与蜂鸣器
笔记·stm32·学习
2601_962073973 小时前
【MySQL】全面学习数据库查询技巧:查询指令深度学习指南
数据库·学习·mysql
存在morning4 小时前
【Paimon 学习笔记 二】存储架构:快照、manifest、LSM 树、bucket
笔记·学习·架构
双眼鈹4 小时前
周报8.31
笔记·学习
打团从来人不齐4 小时前
Linux服务器搭建笔记-008:台式机共享WIFI
linux·服务器·笔记
疯狂打码的少年5 小时前
【数据库技术】SQL概述与数据定义(DDL:CREATE/DROP/ALTER)
数据库·笔记·sql·oracle