Advertisement
go6odn28

slice

Feb 16th, 2024
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. text = "gosho"
  2. first_two_letters = text[:2]
  3. print(first_two_letters)  # go
  4.  
  5. second_two_letters = text[2:4]
  6. print(second_two_letters) # sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement