s = "Hello, World!" print(len(s)) # 13 # Slicing [start:end] print(s[2:5]) # llo (End is exclusive) print(s[:5]) # Hello (Starts from 0) print(s[-6:-1]) # World (Negative indexes) # Modifying print(s.upper()) # HELLO, WORLD! print(s.replace("H", "J")) # Jello, World! print(s.split(",")) # ['Hello', ' World!']
'''text'''
print(a[1])
[start:end]
↳Python has a set of built-in methods that you can use on strings, like upper(), lower(), replace(), and split().
upper()
lower()
replace()
split()