- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
string.punctuation in Python
In this tutorial, we are going to learn about the string.punctuation string.
The string punctuation is pre-defined in the string module of Python3. It contains all the characters as a string. We can use it anywhere in the program.
Example
# importing the string module import string # printing the punctuation print(string.punctuation)
Output
If you run the above code, then you will get the following result.
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Conclusion
We can use it to generate strong passwords. Try it out. If you have any doubts in the tutorial, mention them in the comment section.
Advertisements