mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
27 lines
877 B
Python
27 lines
877 B
Python
import string
|
|
|
|
assert string.ascii_letters == "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
assert string.ascii_lowercase == "abcdefghijklmnopqrstuvwxyz"
|
|
assert string.ascii_uppercase == "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
assert string.digits == "0123456789"
|
|
assert string.hexdigits == "0123456789abcdefABCDEF"
|
|
assert string.octdigits == "01234567"
|
|
assert string.punctuation == "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
|
|
assert string.whitespace == " \t\n\r\x0b\x0c", string.whitespace
|
|
assert (
|
|
string.printable
|
|
== "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c"
|
|
)
|
|
|
|
assert string.capwords("bla bla", " ") == "Bla Bla"
|
|
|
|
from string import Template
|
|
|
|
s = Template("$who likes $what")
|
|
r = s.substitute(who="tim", what="kung pow")
|
|
assert r == "tim likes kung pow"
|
|
|
|
from string import Formatter
|
|
|
|
f = Formatter()
|