python“字符串"模块? [英] python "string" module?

查看:59
本文介绍了python“字符串"模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我从2002年左右开始阅读这个旧模块,它的这一行是导入字符串".为了使用字符串类型变量或其他功能,Python是否要求您显式导入字符串模块?我在代码中看不到它像这样使用:

So I'm reading this old module from I think around 2002 and it has this line "import string". Did Python require you to import a string module explicitly before to be able to use string type variables or something? I don't see it used like this in the code:

string.something

推荐答案

string模块包含

The string module contains a set of useful constants, such as ascii_letters and digits, and the module is often still imported for that reason.

这篇关于python“字符串"模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆