Test string formatting.

This commit is contained in:
Captain ALM 2022-11-30 17:19:49 +00:00
parent 1d49cde01d
commit 399ddc8ffd
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
1 changed files with 7 additions and 8 deletions

15
main.py
View File

@ -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))