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)
相关推荐
科技林总11 分钟前
【系统分析师】4.6 构件与中间件
学习
23124_8012 分钟前
CTFshow学习记录
学习
星火开发设计25 分钟前
C++ 函数定义与调用:程序模块化的第一步
java·开发语言·c++·学习·函数·知识
嗯嗯=38 分钟前
STM32单片机学习篇3
stm32·单片机·学习
43v3rY0unG39 分钟前
哈希表学习
学习·哈希算法·散列表
AI_零食1 小时前
鸿蒙跨端框架 Flutter 学习 Day 6:异步编程:等待的艺术
学习·flutter·华为·交互·harmonyos·鸿蒙
梁洪飞1 小时前
通过链接文件和Start.S学习armv7
linux·arm开发·嵌入式硬件·学习·arm
小赵还有头发2 小时前
安装Ceres与glog
linux·学习·无人机·ceres·glog
Engineer邓祥浩2 小时前
设计模式学习(16) 23-14 命令模式
学习·设计模式·命令模式
zhangrelay2 小时前
ROS云课三分钟-cmake默认版本和升级-260120
笔记·学习