Mindblown/string_and_bytes.py

22 lines
464 B
Python
Raw Normal View History

# just why?
print("a" "b" "c")
a = "a" "b" "c"
print(a)
# even works with bytes
print(b"a" b"b" b"c")
b = b"a" b"b" b"c"
print(b)
# Look what I found, a way to edit your bytes ig. Or at least setitem.
c = bytearray(b"Hello, World!")
print(c)
# has to be integer for some reason
c[1] = 101
print(c)
# I mean, editable strings, something we've always wanted
print(c.lower())
print(c.upper())
print(c.split())
print(c.find(b"o"))
# and it has all string methods too