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)
相关推荐
世人万千丶10 小时前
Flutter 框架跨平台鸿蒙开发 - 恐惧清单应用
学习·flutter·华为·开源·harmonyos·鸿蒙
yuzhuanhei10 小时前
Visual Studio 配置C++opencv
c++·学习·visual studio
一轮弯弯的明月11 小时前
贝尔数求集合划分方案总数
java·笔记·蓝桥杯·学习心得
此刻觐神11 小时前
IMX6ULL开发板学习-01(Linux文件目录和目录相关命令)
linux·服务器·学习
憧憬从前11 小时前
算法学习记录DAY2
学习
航Hang*11 小时前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
babe小鑫12 小时前
会计岗位学习数据分析的价值分析
学习·数据挖掘·数据分析
千枫s12 小时前
电脑vm虚拟机kali linux安装shannon
学习·网络安全
zjnlswd12 小时前
tkinter学习案例--笔记代码
笔记·学习
咬_咬12 小时前
go语言学习(基本数据类型)
开发语言·学习·golang·数据类型