Test string formatting.
This commit is contained in:
parent
1d49cde01d
commit
399ddc8ffd
15
main.py
15
main.py
@ -1,9 +1,8 @@
|
||||
#String tests
|
||||
a = " !Hello World! "
|
||||
print(a.upper())
|
||||
print(a.lower())
|
||||
print(a.strip())
|
||||
#strip(str_of_targ)
|
||||
print(a.strip((" !")))
|
||||
print(a.replace("H", "J"))
|
||||
print(a.split(" "))
|
||||
a = " !{} {}! "
|
||||
b = " !{1} {0}! "
|
||||
c = "hello"
|
||||
d = "world"
|
||||
print(a.format(c, d))
|
||||
print(b.format(c, d))
|
||||
print(b.format(d, c, a))
|
||||
|
Loading…
Reference in New Issue
Block a user