text="""Got this panda plush toy for my daughter's birthday,who loves it and takes it everywhere. It's soft andsuper cute, and its face has a friendly look. It'sa bit small for what I paid though. I think theremight be other options that are bigger for thesame price. It arrived a day earlier than expected,so I got to play with it myself before I gave itto her."""importrefromcollectionsimportCounterdefwordcount(text:str):# 去除标点符号text=re.sub(f"[!.,?]","",text)# 转换为小写并分割单词words=text.lower().split()# 统计单词returndict(Counter(words))print(wordcount(text))
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2.0","configurations":[{"name":"Python Debugger: Current File","type":"debugpy","request":"launch","program":"${file}","console":"integratedTerminal"}]}
进入 Python 调试后,用上方的按钮进行 Continue,Step Over 等操作;左侧出现 VARIABLES 视图,显示局部和全局变量。