Computer >> Computer tutorials >  >> Programming >> Python

string.octdigits in Python


In this tutorial, we are going to learn about the string.octdigits string.

The string octdigits is pre-defined in the string module of the Python3. We can use the octal digits whenever we want in the program by simply accessing it from the string module.

Example

# importing the string module
import string
# printing the octal digits string
print(string.octdigits)

Output

If you run the above code, then you will get the following result.

01234567

The string.octdigits is a string. You can it by executing the following program.

Example

# importing the string module
import string
# printing the octal digits string
print(type(string.octdigits))

Output

If you run the above code, then you will get the following result.

<class 'str'>

Conclusion

If you have any doubts regarding the tutorial, mention them in the comment section.