You can take slices of strings by using brackets and numbers.
phone = "123-456-7890"
print(phone[:3]) # 123
You can also pick out slices from the middle.
print(phone[5:8]) # 56-
You can also index backwards.
print(phone[-4:]) # 7890
You can take slices of strings by using brackets and numbers.
phone = "123-456-7890"
print(phone[:3]) # 123
You can also pick out slices from the middle.
print(phone[5:8]) # 56-
You can also index backwards.
print(phone[-4:]) # 7890